Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,9 @@ import gradio as gr
|
|
3 |
import torch
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
|
6 |
-
model = AutoModelForCausalLM.from_pretrained("cyberagent/open-calm-
|
7 |
#torch_dtype=torch.float16)
|
8 |
-
tokenizer = AutoTokenizer.from_pretrained("cyberagent/open-calm-
|
9 |
|
10 |
def proc( inputs ):
|
11 |
with torch.no_grad():
|
|
|
3 |
import torch
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
|
6 |
+
model = AutoModelForCausalLM.from_pretrained("cyberagent/open-calm-3b", device_map="auto", torch_dtype=torch.int8, load_in_8bit=True)
|
7 |
#torch_dtype=torch.float16)
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained("cyberagent/open-calm-3b")
|
9 |
|
10 |
def proc( inputs ):
|
11 |
with torch.no_grad():
|