Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,12 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
import json
|
4 |
|
|
|
|
|
5 |
# WARNING: It is not recommended to hardcode sensitive data like API tokens in code.
|
6 |
# Consider using environment variables or other secure methods for production applications.
|
7 |
API_URL = "https://deployment.datasaur.ai/api/deployment/8/2717/chat/completions"
|
8 |
-
API_TOKEN = "
|
9 |
|
10 |
def magic_function(input_text):
|
11 |
"""
|
@@ -38,8 +40,11 @@ def magic_function(input_text):
|
|
38 |
|
39 |
|
40 |
with gr.Blocks() as demo:
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
43 |
|
44 |
magic_button.click(
|
45 |
fn=magic_function,
|
|
|
2 |
import requests
|
3 |
import json
|
4 |
|
5 |
+
import os
|
6 |
+
|
7 |
# WARNING: It is not recommended to hardcode sensitive data like API tokens in code.
|
8 |
# Consider using environment variables or other secure methods for production applications.
|
9 |
API_URL = "https://deployment.datasaur.ai/api/deployment/8/2717/chat/completions"
|
10 |
+
API_TOKEN = os.environ["DATASAUR_API_KEY"]
|
11 |
|
12 |
def magic_function(input_text):
|
13 |
"""
|
|
|
40 |
|
41 |
|
42 |
with gr.Blocks() as demo:
|
43 |
+
gr.Markdown("# Memo Improvement Workflow")
|
44 |
+
with gr.Row():
|
45 |
+
text_area = gr.Textbox(label="Your Text", lines=20, scale=4)
|
46 |
+
with gr.Column(scale=1):
|
47 |
+
magic_button = gr.Button("Magic Button")
|
48 |
|
49 |
magic_button.click(
|
50 |
fn=magic_function,
|