Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import torch
|
4 |
|
5 |
-
# Load the model and tokenizer with
|
6 |
model_name = "Flmc/DISC-MedLLM"
|
7 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
9 |
|
10 |
# Function to generate responses
|
11 |
def generate_response(input_text):
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import torch
|
4 |
|
5 |
+
# Load the model and tokenizer with trust_remote_code=True
|
6 |
model_name = "Flmc/DISC-MedLLM"
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", trust_remote_code=True)
|
9 |
|
10 |
# Function to generate responses
|
11 |
def generate_response(input_text):
|