Spaces:
Build error
Build error
Polishing
Browse files
app.py
CHANGED
|
@@ -2,9 +2,7 @@ import openai
|
|
| 2 |
import gradio as gr
|
| 3 |
import datetime
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
initial_prompt = "List the following in a HTML table with about 7 rows in an appropriate order, giving the table an appropriate caption. The table contains about 5 columns with appropriate attributes. Each non-numeric cell in the table, regardless of column, contains a link whenever possible to an appropriate Wikipedia page that opens in a new tab. No other links besides Wikipedia pages are permitted: "
|
| 8 |
|
| 9 |
|
| 10 |
def set_openai_api_key(api_key, openai_api_key):
|
|
@@ -35,10 +33,6 @@ def desc2sheet(desc, openai_api_key, temperature):
|
|
| 35 |
if not openai_api_key or openai_api_key == "":
|
| 36 |
return "<pre>Please paste your OpenAI API key</pre>"
|
| 37 |
|
| 38 |
-
print("\n==== date/time: " + str(datetime.datetime.now()) + " ====")
|
| 39 |
-
print("desc: " + desc)
|
| 40 |
-
print("temperature: ", temperature)
|
| 41 |
-
|
| 42 |
html = openai_create(initial_prompt + desc + '\n', openai_api_key, temperature)
|
| 43 |
return html
|
| 44 |
|
|
@@ -48,7 +42,6 @@ def update_temperature(temp_slider, temp_state):
|
|
| 48 |
temp_state = temp_slider
|
| 49 |
return temp_state
|
| 50 |
|
| 51 |
-
|
| 52 |
block = gr.Blocks(css=".gradio-container {background-color: lightgray}")
|
| 53 |
|
| 54 |
with block:
|
|
@@ -61,7 +54,7 @@ with block:
|
|
| 61 |
table = gr.Markdown("")
|
| 62 |
with gr.Row():
|
| 63 |
request = gr.Textbox(label=initial_prompt,
|
| 64 |
-
placeholder="Ex:
|
| 65 |
|
| 66 |
submit = gr.Button(value="Create", variant="secondary").style(full_width=False)
|
| 67 |
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import datetime
|
| 4 |
|
| 5 |
+
initial_prompt = "List the following in a HTML table with an appropriate number of rows in an appropriate order, giving the table an appropriate caption. The table contains around 4 columns with appropriate attributes. Each non-numeric cell in the table, regardless of column, contains a link whenever possible to an appropriate Wikipedia page that opens in a new tab. No other links besides Wikipedia pages are permitted: "
|
|
|
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def set_openai_api_key(api_key, openai_api_key):
|
|
|
|
| 33 |
if not openai_api_key or openai_api_key == "":
|
| 34 |
return "<pre>Please paste your OpenAI API key</pre>"
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
html = openai_create(initial_prompt + desc + '\n', openai_api_key, temperature)
|
| 37 |
return html
|
| 38 |
|
|
|
|
| 42 |
temp_state = temp_slider
|
| 43 |
return temp_state
|
| 44 |
|
|
|
|
| 45 |
block = gr.Blocks(css=".gradio-container {background-color: lightgray}")
|
| 46 |
|
| 47 |
with block:
|
|
|
|
| 54 |
table = gr.Markdown("")
|
| 55 |
with gr.Row():
|
| 56 |
request = gr.Textbox(label=initial_prompt,
|
| 57 |
+
placeholder="Ex: Computer languages")
|
| 58 |
|
| 59 |
submit = gr.Button(value="Create", variant="secondary").style(full_width=False)
|
| 60 |
|