Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
|
|
3 |
import numpy as np
|
4 |
from transformers import pipeline, BertTokenizer, BertModel
|
5 |
import faiss
|
|
|
6 |
|
7 |
# Load CSV data
|
8 |
data = pd.read_csv('RBDx10stats.csv')
|
@@ -29,6 +30,7 @@ tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
|
29 |
model = BertModel.from_pretrained('bert-base-uncased')
|
30 |
|
31 |
# Function to retrieve the relevant document and generate a response
|
|
|
32 |
def retrieve_and_generate(question):
|
33 |
# Embed the question
|
34 |
question_embedding = embed_question(question, model, tokenizer)
|
|
|
3 |
import numpy as np
|
4 |
from transformers import pipeline, BertTokenizer, BertModel
|
5 |
import faiss
|
6 |
+
import spaces
|
7 |
|
8 |
# Load CSV data
|
9 |
data = pd.read_csv('RBDx10stats.csv')
|
|
|
30 |
model = BertModel.from_pretrained('bert-base-uncased')
|
31 |
|
32 |
# Function to retrieve the relevant document and generate a response
|
33 |
+
@spaces.GPU(duration=120)
|
34 |
def retrieve_and_generate(question):
|
35 |
# Embed the question
|
36 |
question_embedding = embed_question(question, model, tokenizer)
|