Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,21 +16,10 @@ def generate_text(prompt):
|
|
16 |
max_tokens=1024,
|
17 |
prompt=prompt
|
18 |
)
|
19 |
-
return response.choices[0].text.strip()
|
20 |
-
|
21 |
-
# Define password-protected Gradio interface
|
22 |
-
def check_password(password):
|
23 |
-
if password == "patti-ai":
|
24 |
-
demo.interface.visible = True
|
25 |
-
demo.password_box.visible = False
|
26 |
-
return "Access granted"
|
27 |
-
else:
|
28 |
-
demo.interface.visible = False
|
29 |
-
demo.password_box.visible = True
|
30 |
-
return "Access denied"
|
31 |
-
|
32 |
|
33 |
# Create Gradio interface
|
|
|
34 |
input_text = gr.Textbox(label="Enter prompt", type="password")
|
35 |
output_text = gr.Textbox(label="AI Response", type="text")
|
36 |
demo = gr.Interface(
|
@@ -43,5 +32,16 @@ demo = gr.Interface(
|
|
43 |
theme="default"
|
44 |
)
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
# Launch demo
|
47 |
demo.launch()
|
|
|
16 |
max_tokens=1024,
|
17 |
prompt=prompt
|
18 |
)
|
19 |
+
return response.choices[0].text.strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
# Create Gradio interface
|
22 |
+
password_box = gr.Textbox(label="Enter password", type="password")
|
23 |
input_text = gr.Textbox(label="Enter prompt", type="password")
|
24 |
output_text = gr.Textbox(label="AI Response", type="text")
|
25 |
demo = gr.Interface(
|
|
|
32 |
theme="default"
|
33 |
)
|
34 |
|
35 |
+
# Define password-protected Gradio interface
|
36 |
+
def check_password(password):
|
37 |
+
if password == "patti-ai":
|
38 |
+
demo.interface.visible = True
|
39 |
+
demo.password_box.visible = False
|
40 |
+
return "Access granted"
|
41 |
+
else:
|
42 |
+
demo.interface.visible = False
|
43 |
+
demo.password_box.visible = True
|
44 |
+
return "Access denied"
|
45 |
+
|
46 |
# Launch demo
|
47 |
demo.launch()
|