Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -31,11 +31,6 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
31 |
model.config.sliding_window = 4096
|
32 |
model.eval()
|
33 |
|
34 |
-
terminators = [
|
35 |
-
pipeline.tokenizer.eos_token_id,
|
36 |
-
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
37 |
-
]
|
38 |
-
|
39 |
@spaces.GPU(duration=90)
|
40 |
def generate(
|
41 |
message: str,
|
@@ -66,7 +61,6 @@ def generate(
|
|
66 |
temperature=temperature,
|
67 |
num_beams=1,
|
68 |
repetition_penalty=repetition_penalty,
|
69 |
-
eos_token_id=terminators,
|
70 |
)
|
71 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
72 |
t.start()
|
|
|
31 |
model.config.sliding_window = 4096
|
32 |
model.eval()
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
@spaces.GPU(duration=90)
|
35 |
def generate(
|
36 |
message: str,
|
|
|
61 |
temperature=temperature,
|
62 |
num_beams=1,
|
63 |
repetition_penalty=repetition_penalty,
|
|
|
64 |
)
|
65 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
66 |
t.start()
|