richardr1126 commited on
Commit
819c99b
1 Parent(s): d9f1ea1
Files changed (1) hide show
  1. app-ngrok.py +4 -10
app-ngrok.py CHANGED
@@ -76,14 +76,6 @@ def log_rating_to_firestore(input_message, db_info, temperature, response_text,
76
  gr.Info("Thanks for your feedback!")
77
  # End Firebase code
78
 
79
- def copy_to_clipboard(text):
80
- # Copy to clipboard
81
- try:
82
- pyperclip.copy(text)
83
- gr.Info("Copied to clipboard!")
84
- except Exception:
85
- gr.Warning("Couldn't copy to clipboard :(")
86
-
87
  def format(text):
88
  # Split the text by "|", and get the last element in the list which should be the final query
89
  try:
@@ -148,6 +140,7 @@ def generate(input_message: str, db_info="", temperature=0.2, top_p=0.9, top_k=0
148
  except Exception as e:
149
  print(f'Error occurred: {str(e)}')
150
  print('Waiting for 10 seconds before retrying...')
 
151
  sleep(10)
152
 
153
  # Gradio UI Code
@@ -156,8 +149,9 @@ with gr.Blocks(theme='gradio/soft') as demo:
156
  header = gr.HTML("""
157
  <h1 style="text-align: center">SQL Skeleton WizardCoder Demo</h1>
158
  <h3 style="text-align: center">🕷️☠️🧙‍♂️ Generate SQL queries from Natural Language 🕷️☠️🧙‍♂️</h3>
159
- <br>
160
- <p style="font-size: 12px; text-align: center">⚠️ Should take 30-60s to generate. Please rate the response, it helps a lot.</p>
 
161
  """)
162
 
163
  output_box = gr.Code(label="Generated SQL", lines=2, interactive=False)
 
76
  gr.Info("Thanks for your feedback!")
77
  # End Firebase code
78
 
 
 
 
 
 
 
 
 
79
  def format(text):
80
  # Split the text by "|", and get the last element in the list which should be the final query
81
  try:
 
140
  except Exception as e:
141
  print(f'Error occurred: {str(e)}')
142
  print('Waiting for 10 seconds before retrying...')
143
+ gr.Warning("Error occurred, retrying, the sever may be down...")
144
  sleep(10)
145
 
146
  # Gradio UI Code
 
149
  header = gr.HTML("""
150
  <h1 style="text-align: center">SQL Skeleton WizardCoder Demo</h1>
151
  <h3 style="text-align: center">🕷️☠️🧙‍♂️ Generate SQL queries from Natural Language 🕷️☠️🧙‍♂️</h3>
152
+ <div style="max-width: 450px; margin: auto; text-align: center">
153
+ <p style="font-size: 12px; text-align: center">⚠️ Should take 30-60s to generate. Please rate the response, it helps a lot. If you get a blank output, the model server is currently down, please try again another time.</p>
154
+ </div>
155
  """)
156
 
157
  output_box = gr.Code(label="Generated SQL", lines=2, interactive=False)