MFawad commited on
Commit
df37d23
1 Parent(s): 7732649

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,15 +1,18 @@
1
  import streamlit as st
2
  import pickle
3
  import cohere
 
4
 
5
  # Initialize Cohere Client
6
- co = cohere.Client('mBS7SXo0I577gd5g5lScX3rw1YKupJHQq866YvS6') # Replace with your Cohere API key
 
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
- model='7f4b5dda-dcf2-40ca-9d4c-afdcaf435480-ft', # Replace with your Cohere model ID
 
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,