Bofandra commited on
Commit
067403b
·
verified ·
1 Parent(s): a5ae978

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,9 +30,9 @@ def respond(
30
  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."})
31
 
32
  #adding fatwa references
33
-
34
- selected_references = torch.load('selected_references.sav', map_location=torch.device('cpu'))
35
- encoded_questions = torch.load('encoded_questions.sav', map_location=torch.device('cpu'))
36
 
37
  task = 'Given a web search query, retrieve relevant passages that answer the query'
38
  queries = [
 
30
  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."})
31
 
32
  #adding fatwa references
33
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
34
+ selected_references = torch.load('selected_references.sav', map_location=torch.device(device))
35
+ encoded_questions = torch.load('encoded_questions.sav', map_location=torch.device(device))
36
 
37
  task = 'Given a web search query, retrieve relevant passages that answer the query'
38
  queries = [