Spaces:
Sleeping
Sleeping
Patrik Stano commited on
Commit ·
d652a9d
1
Parent(s): bceb38f
fix generation bug
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ def predict(text_input):
|
|
| 8 |
"""
|
| 9 |
Generate a prediction for the given input text using the Hugging Face model.
|
| 10 |
"""
|
| 11 |
-
input_length = len(tokenizer(
|
| 12 |
generation_parameters = {
|
| 13 |
"min_length": input_length + 5, # Set your desired minimum length
|
| 14 |
"max_length": input_length + 10 # Set your desired maximum length
|
|
@@ -32,4 +32,4 @@ interface = gr.Interface(
|
|
| 32 |
|
| 33 |
# Launch the Gradio app
|
| 34 |
if __name__ == "__main__":
|
| 35 |
-
interface.launch()
|
|
|
|
| 8 |
"""
|
| 9 |
Generate a prediction for the given input text using the Hugging Face model.
|
| 10 |
"""
|
| 11 |
+
input_length = len(tokenizer(text_input)["input_ids"])
|
| 12 |
generation_parameters = {
|
| 13 |
"min_length": input_length + 5, # Set your desired minimum length
|
| 14 |
"max_length": input_length + 10 # Set your desired maximum length
|
|
|
|
| 32 |
|
| 33 |
# Launch the Gradio app
|
| 34 |
if __name__ == "__main__":
|
| 35 |
+
interface.launch(share=True)
|