Ashhar commited on
Commit
c7f1ed1
1 Parent(s): 4f7e8f2

increase input box height'

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -40,6 +40,7 @@ A. I love to eat eggs for breakfast! 🧦🍳 Eggs are healthy as well as tasty
40
  """
41
 
42
  ipAddress = ""
 
43
 
44
 
45
  def __nowInIST():
@@ -64,7 +65,7 @@ def autocomplete(text):
64
 
65
  if text != "":
66
  if text[-1] != " ":
67
- # yield lastResponse
68
  return
69
 
70
  pprint(f"{text=}")
@@ -92,9 +93,9 @@ def autocomplete(text):
92
  partialMessage = partialMessage + chunk.choices[0].delta.content
93
  yield partialMessage
94
  pprint(f"{partialMessage=}")
95
- # lastResponse = partialMessage
96
- # else:
97
- # lastResponse = ""
98
 
99
 
100
  css = """
@@ -110,7 +111,7 @@ with gr.Blocks(css=css, title="Create interesting sentences on the fly ✈") as
110
 
111
  with gr.Row():
112
  input_box = gr.Textbox(
113
- lines=2,
114
  placeholder="Start typing ...",
115
  label="Input Sentence",
116
  )
@@ -170,4 +171,4 @@ with gr.Blocks(css=css, title="Create interesting sentences on the fly ✈") as
170
  demo.launch(
171
  debug=True,
172
  server_name="0.0.0.0",
173
- )
 
40
  """
41
 
42
  ipAddress = ""
43
+ lastResponse = ""
44
 
45
 
46
  def __nowInIST():
 
65
 
66
  if text != "":
67
  if text[-1] != " ":
68
+ yield lastResponse
69
  return
70
 
71
  pprint(f"{text=}")
 
93
  partialMessage = partialMessage + chunk.choices[0].delta.content
94
  yield partialMessage
95
  pprint(f"{partialMessage=}")
96
+ lastResponse = partialMessage
97
+ else:
98
+ lastResponse = ""
99
 
100
 
101
  css = """
 
111
 
112
  with gr.Row():
113
  input_box = gr.Textbox(
114
+ lines=5,
115
  placeholder="Start typing ...",
116
  label="Input Sentence",
117
  )
 
171
  demo.launch(
172
  debug=True,
173
  server_name="0.0.0.0",
174
+ )