Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,9 +25,9 @@
|
|
25 |
import gradio as gr
|
26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
27 |
|
28 |
-
model_name = "
|
29 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
30 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
31 |
|
32 |
def generate_answer(question):
|
33 |
inputs = tokenizer.encode("Question: " + question, return_tensors="pt")
|
|
|
25 |
import gradio as gr
|
26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
27 |
|
28 |
+
model_name = "microsoft/phi-2"
|
29 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
30 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
31 |
|
32 |
def generate_answer(question):
|
33 |
inputs = tokenizer.encode("Question: " + question, return_tensors="pt")
|