Spaces:
Runtime error
Runtime error
zaeemzafar
commited on
Commit
•
1ae2696
1
Parent(s):
9736f87
Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,12 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
3 |
import torch
|
4 |
|
5 |
# Load the model and tokenizer
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
def respond_to_query(user_input):
|
11 |
input_ids = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")
|
|
|
3 |
import torch
|
4 |
|
5 |
# Load the model and tokenizer
|
6 |
+
|
7 |
+
# Load model directly
|
8 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
9 |
+
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("valeriojob/MedGPT-Llama3.1-8B-BA-v.1")
|
11 |
+
model = AutoModelForCausalLM.from_pretrained("valeriojob/MedGPT-Llama3.1-8B-BA-v.1")
|
12 |
|
13 |
def respond_to_query(user_input):
|
14 |
input_ids = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")
|