Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Commit
•
6fa1c6b
1
Parent(s):
7d56735
Update other_function.py
Browse files- other_function.py +2 -2
other_function.py
CHANGED
@@ -16,14 +16,14 @@ if not os.path.exists(UPLOAD_FOLDER):
|
|
16 |
os.makedirs(UPLOAD_FOLDER)
|
17 |
|
18 |
AI71_API_KEY = os.environ.get('AI71_API_KEY')
|
19 |
-
def generate_response(query):
|
20 |
response = ''
|
21 |
for chunk in AI71(AI71_API_KEY).chat.completions.create(
|
22 |
model="tiiuae/falcon-180b-chat",
|
23 |
messages=[
|
24 |
{"role": "system", "content": "You are a best agricultural assistant.Remember to give response not more than 2 sentence"},
|
25 |
{"role": "user",
|
26 |
-
"content": f'''Answer the query:{query}'''},
|
27 |
],
|
28 |
stream=True,
|
29 |
):
|
|
|
16 |
os.makedirs(UPLOAD_FOLDER)
|
17 |
|
18 |
AI71_API_KEY = os.environ.get('AI71_API_KEY')
|
19 |
+
def generate_response(query,chat_history):
|
20 |
response = ''
|
21 |
for chunk in AI71(AI71_API_KEY).chat.completions.create(
|
22 |
model="tiiuae/falcon-180b-chat",
|
23 |
messages=[
|
24 |
{"role": "system", "content": "You are a best agricultural assistant.Remember to give response not more than 2 sentence"},
|
25 |
{"role": "user",
|
26 |
+
"content": f'''Answer the query based on history {chat_history}:{query}'''},
|
27 |
],
|
28 |
stream=True,
|
29 |
):
|