ThomasBlumet
commited on
Commit
·
2d4b9ba
1
Parent(s):
3a1a0ef
changemodel config for exllama
Browse files
app.py
CHANGED
@@ -18,6 +18,10 @@ def generate_text(input_text):
|
|
18 |
output = model.generate(input_ids, max_new_tokens=512, top_k=50, top_p=0.95, temperature=0.7, do_sample=True)# attention_mask=attention_mask, max_length=100, num_return_sequences=1, no_repeat_ngram_size=2, top_k=50, top_p=0.95, temperature=0.7, do_sample=True)
|
19 |
return tokenizer.decode(output[0])
|
20 |
|
|
|
|
|
|
|
|
|
21 |
# def generate_text(prompt):
|
22 |
# inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=512, padding="max_length")
|
23 |
# summary_ids = model.generate(inputs["input_ids"], max_new_tokens=512, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
|
|
|
18 |
output = model.generate(input_ids, max_new_tokens=512, top_k=50, top_p=0.95, temperature=0.7, do_sample=True)# attention_mask=attention_mask, max_length=100, num_return_sequences=1, no_repeat_ngram_size=2, top_k=50, top_p=0.95, temperature=0.7, do_sample=True)
|
19 |
return tokenizer.decode(output[0])
|
20 |
|
21 |
+
# Example of disabling Exllama backend (if applicable in your configuration)
|
22 |
+
config = {"disable_exllama": True}
|
23 |
+
model.config.update(config)
|
24 |
+
|
25 |
# def generate_text(prompt):
|
26 |
# inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=512, padding="max_length")
|
27 |
# summary_ids = model.generate(inputs["input_ids"], max_new_tokens=512, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
|