Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,11 +31,9 @@ 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 |
-
|
35 |
-
|
36 |
-
|
37 |
-
selected_references = pickle.load(open('selected_references.sav','rb'))
|
38 |
-
encoded_questions = pickle.load(open('encoded_questions.sav','rb'))
|
39 |
|
40 |
task = 'Given a web search query, retrieve relevant passages that answer the query'
|
41 |
queries = [
|
|
|
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))
|
|
|
|
|
37 |
|
38 |
task = 'Given a web search query, retrieve relevant passages that answer the query'
|
39 |
queries = [
|