Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,8 @@ import gradio as gr
|
|
| 4 |
import random
|
| 5 |
import time
|
| 6 |
import os
|
|
|
|
|
|
|
| 7 |
|
| 8 |
API_TOKEN = os.getenv("API_TOKEN")
|
| 9 |
from huggingface_hub import InferenceApi
|
|
@@ -73,7 +75,9 @@ def infer(prompt,
|
|
| 73 |
return response
|
| 74 |
|
| 75 |
def getideas(text_inp):
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
text = prompt+"\nInput:"+text_inp + "\nOutput:"
|
| 78 |
resp = infer(text,seed=random.randint(0,100))
|
| 79 |
|
|
@@ -83,6 +87,7 @@ def getideas(text_inp):
|
|
| 83 |
parts = result.split("###")
|
| 84 |
topic = parts[0].strip()
|
| 85 |
topic="\n".join(topic.split('\n')[:3])
|
|
|
|
| 86 |
return(topic)
|
| 87 |
|
| 88 |
|
|
|
|
| 4 |
import random
|
| 5 |
import time
|
| 6 |
import os
|
| 7 |
+
import datetime
|
| 8 |
+
from datetime import datetime
|
| 9 |
|
| 10 |
API_TOKEN = os.getenv("API_TOKEN")
|
| 11 |
from huggingface_hub import InferenceApi
|
|
|
|
| 75 |
return response
|
| 76 |
|
| 77 |
def getideas(text_inp):
|
| 78 |
+
print(text_inp)
|
| 79 |
+
print(datetime.today().strftime("%d-%m-%Y"))
|
| 80 |
+
|
| 81 |
text = prompt+"\nInput:"+text_inp + "\nOutput:"
|
| 82 |
resp = infer(text,seed=random.randint(0,100))
|
| 83 |
|
|
|
|
| 87 |
parts = result.split("###")
|
| 88 |
topic = parts[0].strip()
|
| 89 |
topic="\n".join(topic.split('\n')[:3])
|
| 90 |
+
print(topic)
|
| 91 |
return(topic)
|
| 92 |
|
| 93 |
|