Spaces:
Running
Running
Commit
•
c194e76
1
Parent(s):
ae89068
Update app.py
Browse files
app.py
CHANGED
@@ -99,9 +99,8 @@ def clear_history():
|
|
99 |
print(">>> HISTORY CLEARED!")
|
100 |
return []
|
101 |
|
102 |
-
def
|
103 |
-
print("
|
104 |
-
return ("SUCCESS!", "SUCCESS!")
|
105 |
|
106 |
with gr.Blocks() as demo:
|
107 |
with gr.Row(variant = "panel"):
|
@@ -116,7 +115,7 @@ with gr.Blocks() as demo:
|
|
116 |
access_key = gr.Textbox(label = "Access Key", lines = 1)
|
117 |
run = gr.Button("▶")
|
118 |
clear = gr.Button("🗑️")
|
119 |
-
|
120 |
|
121 |
with gr.Column():
|
122 |
model = gr.Dropdown(choices = CHOICES, value = next(iter(API_ENDPOINTS)), interactive = True, label = "Model")
|
@@ -134,6 +133,6 @@ with gr.Blocks() as demo:
|
|
134 |
|
135 |
run.click(predict, inputs = [access_key, instruction, history, input, wrap, model, temperature, top_p, top_k, rep_p, max_tokens, stop_seqs, seed], outputs = [output, input, history], queue = False)
|
136 |
clear.click(clear_history, [], history, queue = False)
|
137 |
-
|
138 |
|
139 |
demo.launch(show_api = True)
|
|
|
99 |
print(">>> HISTORY CLEARED!")
|
100 |
return []
|
101 |
|
102 |
+
def cloud():
|
103 |
+
print("[CLOUD] | Space maintained.")
|
|
|
104 |
|
105 |
with gr.Blocks() as demo:
|
106 |
with gr.Row(variant = "panel"):
|
|
|
115 |
access_key = gr.Textbox(label = "Access Key", lines = 1)
|
116 |
run = gr.Button("▶")
|
117 |
clear = gr.Button("🗑️")
|
118 |
+
maintain = gr.Button("☁️")
|
119 |
|
120 |
with gr.Column():
|
121 |
model = gr.Dropdown(choices = CHOICES, value = next(iter(API_ENDPOINTS)), interactive = True, label = "Model")
|
|
|
133 |
|
134 |
run.click(predict, inputs = [access_key, instruction, history, input, wrap, model, temperature, top_p, top_k, rep_p, max_tokens, stop_seqs, seed], outputs = [output, input, history], queue = False)
|
135 |
clear.click(clear_history, [], history, queue = False)
|
136 |
+
maintain.click(cloud, inputs = [], outputs = [], queue = False)
|
137 |
|
138 |
demo.launch(show_api = True)
|