Yoxas commited on
Commit
a63f6c6
·
verified ·
1 Parent(s): 86876ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import torch
3
  from sentence_transformers import SentenceTransformer, util
4
  import gradio as gr
5
  import json
6
- from transformers import AutoTokenizer, AutoModelForCausalLM
7
  import spaces
8
 
9
  # Ensure you have GPU support
@@ -20,8 +20,8 @@ embeddings = torch.tensor(df['embedding'].tolist(), device=device)
20
  model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
21
 
22
  # Load the LLaMA model for response generation
23
- llama_tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
24
- llama_model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2").to(device)
25
 
26
  # Define the function to find the most relevant document
27
  @spaces.GPU(duration=120)
 
3
  from sentence_transformers import SentenceTransformer, util
4
  import gradio as gr
5
  import json
6
+ from transformers import AutoTokenizer, AutoModelForQuestionAnswering
7
  import spaces
8
 
9
  # Ensure you have GPU support
 
20
  model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
21
 
22
  # Load the LLaMA model for response generation
23
+ llama_tokenizer = AutoTokenizer.from_pretrained("distilbert/distilbert-base-uncased-distilled-squad")
24
+ llama_model = AutoModelForQuestionAnswering.from_pretrained("distilbert/distilbert-base-uncased-distilled-squad").to(device)
25
 
26
  # Define the function to find the most relevant document
27
  @spaces.GPU(duration=120)