Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -15,12 +15,12 @@ examples = [["Adventurer is approached by a mysterious stranger in the tavern fo
|
|
15 |
tokenizer = BloomTokenizerFast.from_pretrained("tomrb/bettercallbloom-3b")
|
16 |
model = BloomForCausalLM.from_pretrained("tomrb/bettercallbloom-3b",low_cpu_mem_usage=True)
|
17 |
|
18 |
-
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
19 |
|
20 |
|
21 |
def preprocess(text):
|
22 |
#We add 'Question :' and 'Answer #1:' at the start and end of the prompt
|
23 |
-
return "
|
24 |
|
25 |
|
26 |
def generate(text):
|
|
|
15 |
tokenizer = BloomTokenizerFast.from_pretrained("tomrb/bettercallbloom-3b")
|
16 |
model = BloomForCausalLM.from_pretrained("tomrb/bettercallbloom-3b",low_cpu_mem_usage=True)
|
17 |
|
18 |
+
generator = pipeline('text-generation', model=model, tokenizer=tokenizer,do_sample=False)
|
19 |
|
20 |
|
21 |
def preprocess(text):
|
22 |
#We add 'Question :' and 'Answer #1:' at the start and end of the prompt
|
23 |
+
return "\nQuestion: " + text + "\nAnswer #1:"
|
24 |
|
25 |
|
26 |
def generate(text):
|