Spaces:
Running
on
A10G
Running
on
A10G
artificialguybr
commited on
Commit
•
e586fb9
1
Parent(s):
bdb430b
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
6 |
from transformers.generation import GenerationConfig
|
7 |
|
8 |
# Initialize model and tokenizer
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen-
|
10 |
-
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-
|
11 |
-
model.generation_config = GenerationConfig.from_pretrained("Qwen/Qwen-
|
12 |
|
13 |
# Postprocess function
|
14 |
def postprocess(self, y):
|
|
|
6 |
from transformers.generation import GenerationConfig
|
7 |
|
8 |
# Initialize model and tokenizer
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen-14B-Chat", trust_remote_code=True)
|
10 |
+
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-14B-Chat", device_map="auto", trust_remote_code=True).eval()
|
11 |
+
model.generation_config = GenerationConfig.from_pretrained("Qwen/Qwen-14B-Chat", trust_remote_code=True)
|
12 |
|
13 |
# Postprocess function
|
14 |
def postprocess(self, y):
|