Spaces:
Sleeping
Sleeping
Ashhar
commited on
Commit
·
e4f4c98
1
Parent(s):
62f62db
debugging
Browse files
app.py
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
-
"""
|
2 |
-
app.py
|
3 |
-
"""
|
4 |
import os
|
5 |
|
6 |
import gradio as gr
|
7 |
from groq import Groq
|
8 |
import datetime as DT
|
9 |
import pytz
|
|
|
10 |
from dotenv import load_dotenv
|
11 |
load_dotenv()
|
12 |
|
@@ -40,8 +38,8 @@ A. I love to eat eggs for breakfast! 🧦🍳 Eggs are healthy as well as tasty
|
|
40 |
|
41 |
"""
|
42 |
|
43 |
-
lastResponse =
|
44 |
-
ipAddress =
|
45 |
|
46 |
|
47 |
def __nowInIST():
|
@@ -96,13 +94,13 @@ def autocomplete(text):
|
|
96 |
pprint(f"{partialMessage=}")
|
97 |
lastResponse = partialMessage
|
98 |
else:
|
99 |
-
lastResponse =
|
100 |
|
101 |
|
102 |
css = """
|
103 |
-
.generating {
|
104 |
-
|
105 |
-
}
|
106 |
"""
|
107 |
|
108 |
inputBox = gr.Textbox(
|
@@ -114,16 +112,6 @@ outputBox = gr.Markdown(
|
|
114 |
label="Output Sentence"
|
115 |
)
|
116 |
|
117 |
-
copyButton = gr.Button(
|
118 |
-
"Use Output",
|
119 |
-
elem_id="copy-button",
|
120 |
-
variant="primary"
|
121 |
-
).click(
|
122 |
-
fn=lambda x: x,
|
123 |
-
inputs=outputBox,
|
124 |
-
outputs=inputBox,
|
125 |
-
)
|
126 |
-
|
127 |
with gr.Interface(
|
128 |
fn=autocomplete,
|
129 |
inputs=inputBox,
|
@@ -135,7 +123,15 @@ with gr.Interface(
|
|
135 |
css=css
|
136 |
) as demo:
|
137 |
# demo.load(__attachIp, None, None)
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
# Launch the app
|
141 |
demo.launch(debug=True)
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
|
3 |
import gradio as gr
|
4 |
from groq import Groq
|
5 |
import datetime as DT
|
6 |
import pytz
|
7 |
+
|
8 |
from dotenv import load_dotenv
|
9 |
load_dotenv()
|
10 |
|
|
|
38 |
|
39 |
"""
|
40 |
|
41 |
+
lastResponse = ""
|
42 |
+
ipAddress = ""
|
43 |
|
44 |
|
45 |
def __nowInIST():
|
|
|
94 |
pprint(f"{partialMessage=}")
|
95 |
lastResponse = partialMessage
|
96 |
else:
|
97 |
+
lastResponse = ""
|
98 |
|
99 |
|
100 |
css = """
|
101 |
+
# .generating {
|
102 |
+
# display: none
|
103 |
+
# }
|
104 |
"""
|
105 |
|
106 |
inputBox = gr.Textbox(
|
|
|
112 |
label="Output Sentence"
|
113 |
)
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
with gr.Interface(
|
116 |
fn=autocomplete,
|
117 |
inputs=inputBox,
|
|
|
123 |
css=css
|
124 |
) as demo:
|
125 |
# demo.load(__attachIp, None, None)
|
126 |
+
copyButton = gr.Button(
|
127 |
+
"Use Output",
|
128 |
+
elem_id="copy-button",
|
129 |
+
variant="primary"
|
130 |
+
).click(
|
131 |
+
fn=lambda x: x,
|
132 |
+
inputs=outputBox,
|
133 |
+
outputs=inputBox,
|
134 |
+
)
|
135 |
|
136 |
# Launch the app
|
137 |
demo.launch(debug=True)
|