Spaces:
Runtime error
Runtime error
work on dialogue models
Browse files
model.py
CHANGED
@@ -13,7 +13,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
13 |
config=config,
|
14 |
#torch_dtype=torch.float16,
|
15 |
#load_in_4bit=True,
|
16 |
-
device_map='
|
17 |
)
|
18 |
#else:
|
19 |
# model = None
|
@@ -55,7 +55,7 @@ def run(message: str,
|
|
55 |
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False)
|
56 |
|
57 |
streamer = TextIteratorStreamer(tokenizer,
|
58 |
-
timeout=
|
59 |
skip_prompt=True,
|
60 |
skip_special_tokens=True)
|
61 |
generate_kwargs = dict(
|
|
|
13 |
config=config,
|
14 |
#torch_dtype=torch.float16,
|
15 |
#load_in_4bit=True,
|
16 |
+
device_map='auto'
|
17 |
)
|
18 |
#else:
|
19 |
# model = None
|
|
|
55 |
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False)
|
56 |
|
57 |
streamer = TextIteratorStreamer(tokenizer,
|
58 |
+
timeout=60.,
|
59 |
skip_prompt=True,
|
60 |
skip_special_tokens=True)
|
61 |
generate_kwargs = dict(
|