Spaces:
Running
Running
fix 8
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ def generate_text(
|
|
| 35 |
do_sample
|
| 36 |
):
|
| 37 |
try:
|
| 38 |
-
|
| 39 |
|
| 40 |
response = client.text_generation(
|
| 41 |
prompt,
|
|
@@ -46,10 +46,10 @@ def generate_text(
|
|
| 46 |
do_sample=True
|
| 47 |
)
|
| 48 |
|
| 49 |
-
|
| 50 |
return response
|
| 51 |
except Exception as e:
|
| 52 |
-
|
| 53 |
return f"An error occurred: {type(e).__name__}: {str(e)}"
|
| 54 |
|
| 55 |
|
|
|
|
| 35 |
do_sample
|
| 36 |
):
|
| 37 |
try:
|
| 38 |
+
print(f"Attempting to generate text for prompt: {prompt[:50]}...")
|
| 39 |
|
| 40 |
response = client.text_generation(
|
| 41 |
prompt,
|
|
|
|
| 46 |
do_sample=True
|
| 47 |
)
|
| 48 |
|
| 49 |
+
print(f"Generated text: {response[:100]}...")
|
| 50 |
return response
|
| 51 |
except Exception as e:
|
| 52 |
+
print(f"Error in generate_text: {type(e).__name__}: {str(e)}")
|
| 53 |
return f"An error occurred: {type(e).__name__}: {str(e)}"
|
| 54 |
|
| 55 |
|