Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,7 @@ def respond(
|
|
31 |
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."})
|
32 |
|
33 |
#adding fatwa references
|
|
|
34 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
35 |
selected_references = torch.load('selected_references.sav', map_location=torch.device(device))
|
36 |
encoded_questions = torch.load('encoded_questions.sav', map_location=torch.device(device))
|
@@ -81,7 +82,7 @@ def respond(
|
|
81 |
for index, row in df.iterrows():
|
82 |
messages.append({"role": "user", "content": row['user']})
|
83 |
messages.append({"role": "assistant", "content": row['assistant']})
|
84 |
-
|
85 |
#latest user question
|
86 |
translator = Translator()
|
87 |
en_message = ""
|
|
|
31 |
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."})
|
32 |
|
33 |
#adding fatwa references
|
34 |
+
'''
|
35 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
36 |
selected_references = torch.load('selected_references.sav', map_location=torch.device(device))
|
37 |
encoded_questions = torch.load('encoded_questions.sav', map_location=torch.device(device))
|
|
|
82 |
for index, row in df.iterrows():
|
83 |
messages.append({"role": "user", "content": row['user']})
|
84 |
messages.append({"role": "assistant", "content": row['assistant']})
|
85 |
+
'''
|
86 |
#latest user question
|
87 |
translator = Translator()
|
88 |
en_message = ""
|