update qwen remote trust
Browse files
app.py
CHANGED
|
@@ -4,10 +4,10 @@ import torch
|
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
-
# Load Qwen-7B
|
| 8 |
model_name = "Qwen/Qwen-7B"
|
| 9 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 10 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="cpu")
|
| 11 |
|
| 12 |
@app.get("/")
|
| 13 |
def home():
|
|
|
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
+
# Load Qwen-7B dengan trust_remote_code
|
| 8 |
model_name = "Qwen/Qwen-7B"
|
| 9 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 10 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="cpu", trust_remote_code=True)
|
| 11 |
|
| 12 |
@app.get("/")
|
| 13 |
def home():
|