Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,18 @@
|
|
1 |
import streamlit as st
|
2 |
import pickle
|
3 |
import cohere
|
|
|
4 |
|
5 |
# Initialize Cohere Client
|
6 |
-
|
|
|
7 |
|
8 |
# Function to generate text using Cohere API
|
9 |
# Function to generate text using Cohere API
|
10 |
def generate_text(prompt, temperature):
|
11 |
response = co.generate(
|
12 |
-
|
|
|
13 |
prompt=prompt,
|
14 |
max_tokens= 2000,
|
15 |
temperature=temperature,
|
|
|
1 |
import streamlit as st
|
2 |
import pickle
|
3 |
import cohere
|
4 |
+
import os
|
5 |
|
6 |
# Initialize Cohere Client
|
7 |
+
api_key = os.environ["API_KEY"]
|
8 |
+
co = cohere.Client('api_key') # Replace with your Cohere API key
|
9 |
|
10 |
# Function to generate text using Cohere API
|
11 |
# Function to generate text using Cohere API
|
12 |
def generate_text(prompt, temperature):
|
13 |
response = co.generate(
|
14 |
+
model_id = os.environ["MODEL_ID"]
|
15 |
+
model='model_id', # Replace with your Cohere model ID
|
16 |
prompt=prompt,
|
17 |
max_tokens= 2000,
|
18 |
temperature=temperature,
|