Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,9 +25,9 @@ has_cuda = torch.cuda.is_available()
|
|
| 25 |
# has_cuda = False # force cpu
|
| 26 |
|
| 27 |
if has_cuda:
|
| 28 |
-
model = AutoModel.from_pretrained(model_name, trust_remote_code=True).cuda() # 3.
|
| 29 |
else:
|
| 30 |
-
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
|
| 31 |
|
| 32 |
model = model.eval()
|
| 33 |
|
|
@@ -101,7 +101,7 @@ def reset_state():
|
|
| 101 |
|
| 102 |
|
| 103 |
with gr.Blocks() as demo:
|
| 104 |
-
gr.HTML("""<h1 align="center">ChatGLM2-6B-
|
| 105 |
|
| 106 |
chatbot = gr.Chatbot()
|
| 107 |
with gr.Row():
|
|
|
|
| 25 |
# has_cuda = False # force cpu
|
| 26 |
|
| 27 |
if has_cuda:
|
| 28 |
+
model = AutoModel.from_pretrained(model_name, trust_remote_code=True).cuda() # 3.92G
|
| 29 |
else:
|
| 30 |
+
model = AutoModel.from_pretrained(model_name, trust_remote_code=True).float()
|
| 31 |
|
| 32 |
model = model.eval()
|
| 33 |
|
|
|
|
| 101 |
|
| 102 |
|
| 103 |
with gr.Blocks() as demo:
|
| 104 |
+
gr.HTML("""<h1 align="center">ChatGLM2-6B-int4</h1>""")
|
| 105 |
|
| 106 |
chatbot = gr.Chatbot()
|
| 107 |
with gr.Row():
|