Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,9 +40,9 @@ system_prompt = "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n
|
|
| 40 |
#Function to guess whether we use the RAG or not.
|
| 41 |
def classification_chatrag(query):
|
| 42 |
encoding = tokenizer(query, return_tensors="pt")
|
| 43 |
-
encoding = {k: v.to(
|
| 44 |
|
| 45 |
-
outputs =
|
| 46 |
|
| 47 |
logits = outputs.logits
|
| 48 |
logits.shape
|
|
|
|
| 40 |
#Function to guess whether we use the RAG or not.
|
| 41 |
def classification_chatrag(query):
|
| 42 |
encoding = tokenizer(query, return_tensors="pt")
|
| 43 |
+
encoding = {k: v.to(classifier_model.device) for k,v in encoding.items()}
|
| 44 |
|
| 45 |
+
outputs = classifier_model(**encoding)
|
| 46 |
|
| 47 |
logits = outputs.logits
|
| 48 |
logits.shape
|