Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,6 +37,7 @@ def respond(
|
|
37 |
messages.append({"role": "assistant", "content": "I'd be happy to help! Please go ahead and provide the sentence you'd like me to analyze. Please specify whether you're referencing a particular verse or hadith (Prophetic tradition) from the Quran or Hadith, or if you're asking me to analyze a general statement."})
|
38 |
|
39 |
#adding fatwa references
|
|
|
40 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
41 |
selected_references = torch.load('selected_references.sav', map_location=torch.device(device))
|
42 |
encoded_questions = torch.load('encoded_questions.sav', map_location=torch.device(device))
|
@@ -83,7 +84,7 @@ def respond(
|
|
83 |
for index, row in df.iterrows():
|
84 |
messages.append({"role": "user", "content": row['user']})
|
85 |
messages.append({"role": "assistant", "content": row['assistant']})
|
86 |
-
|
87 |
#history from chat session
|
88 |
for val in history:
|
89 |
if val[0]:
|
|
|
37 |
messages.append({"role": "assistant", "content": "I'd be happy to help! Please go ahead and provide the sentence you'd like me to analyze. Please specify whether you're referencing a particular verse or hadith (Prophetic tradition) from the Quran or Hadith, or if you're asking me to analyze a general statement."})
|
38 |
|
39 |
#adding fatwa references
|
40 |
+
'''
|
41 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
42 |
selected_references = torch.load('selected_references.sav', map_location=torch.device(device))
|
43 |
encoded_questions = torch.load('encoded_questions.sav', map_location=torch.device(device))
|
|
|
84 |
for index, row in df.iterrows():
|
85 |
messages.append({"role": "user", "content": row['user']})
|
86 |
messages.append({"role": "assistant", "content": row['assistant']})
|
87 |
+
'''
|
88 |
#history from chat session
|
89 |
for val in history:
|
90 |
if val[0]:
|