shamik
commited on
Commit
·
3d7f161
1
Parent(s):
95e5f77
updated app.py.
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ client = InferenceClient(
|
|
| 7 |
|
| 8 |
punctuation_marks = [".", "!", "?"]
|
| 9 |
def generate(
|
| 10 |
-
prompt,
|
| 11 |
):
|
| 12 |
temperature = float(temperature)
|
| 13 |
if temperature < 1e-2:
|
|
@@ -31,7 +31,6 @@ def generate(
|
|
| 31 |
output += response.token.text
|
| 32 |
while output and output[-1] not in punctuation_marks:
|
| 33 |
output = output[:-1]
|
| 34 |
-
# yield output
|
| 35 |
return output
|
| 36 |
|
| 37 |
|
|
|
|
| 7 |
|
| 8 |
punctuation_marks = [".", "!", "?"]
|
| 9 |
def generate(
|
| 10 |
+
prompt, temperature=0.2, max_new_tokens=256, top_p=0.8, repetition_penalty=1.0,
|
| 11 |
):
|
| 12 |
temperature = float(temperature)
|
| 13 |
if temperature < 1e-2:
|
|
|
|
| 31 |
output += response.token.text
|
| 32 |
while output and output[-1] not in punctuation_marks:
|
| 33 |
output = output[:-1]
|
|
|
|
| 34 |
return output
|
| 35 |
|
| 36 |
|