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
|
@@ -74,6 +76,8 @@ def infer(prompt,
|
|
74 |
return response
|
75 |
|
76 |
def getideas(text_inp):
|
|
|
|
|
77 |
|
78 |
text = prompt+"\nInput:"+text_inp + "\nOutput:"
|
79 |
resp = infer(text,seed=random.randint(0,100))
|
@@ -84,6 +88,7 @@ def getideas(text_inp):
|
|
84 |
parts = result.split("###")
|
85 |
topic = parts[0].strip()
|
86 |
topic="\n".join(topic.split('\n')[:3])
|
|
|
87 |
return(topic)
|
88 |
|
89 |
with gr.Blocks() as demo:
|
|
|
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
|
|
|
76 |
return response
|
77 |
|
78 |
def getideas(text_inp):
|
79 |
+
print(text_inp)
|
80 |
+
print(datetime.today().strftime("%d-%m-%Y"))
|
81 |
|
82 |
text = prompt+"\nInput:"+text_inp + "\nOutput:"
|
83 |
resp = infer(text,seed=random.randint(0,100))
|
|
|
88 |
parts = result.split("###")
|
89 |
topic = parts[0].strip()
|
90 |
topic="\n".join(topic.split('\n')[:3])
|
91 |
+
print(topic)
|
92 |
return(topic)
|
93 |
|
94 |
with gr.Blocks() as demo:
|