Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,8 @@ import gradio as gr
|
|
| 5 |
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
|
| 7 |
# model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True, device='cuda')
|
| 8 |
-
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).float()
|
| 9 |
-
|
| 10 |
model = model.eval()
|
| 11 |
|
| 12 |
def text_generation(prompt: str, style: str) -> str:
|
|
|
|
| 5 |
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
|
| 7 |
# model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True, device='cuda')
|
| 8 |
+
# model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).float()
|
| 9 |
+
model = AutoModel.from_pretrained("THUDM/chatglm2-6b-int4",trust_remote_code=True).float()
|
| 10 |
model = model.eval()
|
| 11 |
|
| 12 |
def text_generation(prompt: str, style: str) -> str:
|