darkc0de commited on
Commit
679e7ad
Β·
verified Β·
1 Parent(s): 78ea248

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  from openai import OpenAI
3
- import os
4
  from dotenv import load_dotenv
5
 
6
  load_dotenv()
@@ -15,7 +15,7 @@ FEATHERLESS_MODEL = "darkc0de/XortronCriminalComputingConfig"
15
 
16
  if not FEATHERLESS_API_KEY:
17
  print("WARNING: FEATHERLESS_API_KEY environment variable is not set.")
18
-
19
  try:
20
  if not FEATHERLESS_API_KEY:
21
  raise ValueError("FEATHERLESS_API_KEY is not set. Please set it as an environment variable or a secret in your deployment environment.")
@@ -107,7 +107,7 @@ kofi_button_html = """
107
  donation_solicitation_html = """
108
  <div style="text-align: center; font-size: x-small; margin-bottom: 5px;">
109
  The Cybernetic Criminal Computing Corporation presents: XORTRON 3.0, free of charge, unlimited, no login, no signup, no bullshit. Finding yourself in a long queue? Consider donating so we can scale and remain 100% free for all. Im sure even a low-life deadbeat freeloader like yourself can at least throw some spare change right? - Support Xortron @ ko-fi.com/xortron<br>
110
-
111
  </div>
112
  """
113
 
@@ -123,6 +123,9 @@ body, .gradio-container {
123
  """
124
 
125
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", head=kofi_script, css=custom_css) as demo:
 
 
 
126
  gr.ChatInterface(
127
  fn=respond, # The function to call when a message is sent
128
  chatbot=gr.Chatbot( # Configure the chatbot display area
@@ -143,10 +146,10 @@ if __name__ == "__main__":
143
  try:
144
  demo.queue(default_concurrency_limit=1)
145
 
146
- demo.launch(show_api=False, share=False)
147
  except NameError as ne:
148
  print(f"Gradio demo could not be launched. 'client' might not have been initialized: {ne}")
149
  except RuntimeError as re:
150
  print(f"Gradio demo could not be launched due to an error during client initialization: {re}")
151
  except Exception as e:
152
- print(f"An unexpected error occurred when trying to launch Gradio demo: {e}")
 
1
  import gradio as gr
2
  from openai import OpenAI
3
+ import os
4
  from dotenv import load_dotenv
5
 
6
  load_dotenv()
 
15
 
16
  if not FEATHERLESS_API_KEY:
17
  print("WARNING: FEATHERLESS_API_KEY environment variable is not set.")
18
+
19
  try:
20
  if not FEATHERLESS_API_KEY:
21
  raise ValueError("FEATHERLESS_API_KEY is not set. Please set it as an environment variable or a secret in your deployment environment.")
 
107
  donation_solicitation_html = """
108
  <div style="text-align: center; font-size: x-small; margin-bottom: 5px;">
109
  The Cybernetic Criminal Computing Corporation presents: XORTRON 3.0, free of charge, unlimited, no login, no signup, no bullshit. Finding yourself in a long queue? Consider donating so we can scale and remain 100% free for all. Im sure even a low-life deadbeat freeloader like yourself can at least throw some spare change right? - Support Xortron @ ko-fi.com/xortron<br>
110
+
111
  </div>
112
  """
113
 
 
123
  """
124
 
125
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", head=kofi_script, css=custom_css) as demo:
126
+ # Added the header image using gr.HTML
127
+ gr.HTML('<img src="https://cdn-uploads.huggingface.co/production/uploads/6540a02d1389943fef4d2640/gSd2uZUcuMGFdqQBf0xNX.jpeg" alt="Header Image" style="display: block; margin-left: auto; margin-right: auto; max-width: 25%; height: auto;">')
128
+
129
  gr.ChatInterface(
130
  fn=respond, # The function to call when a message is sent
131
  chatbot=gr.Chatbot( # Configure the chatbot display area
 
146
  try:
147
  demo.queue(default_concurrency_limit=1)
148
 
149
+ demo.launch(show_api=False, share=False)
150
  except NameError as ne:
151
  print(f"Gradio demo could not be launched. 'client' might not have been initialized: {ne}")
152
  except RuntimeError as re:
153
  print(f"Gradio demo could not be launched due to an error during client initialization: {re}")
154
  except Exception as e:
155
+ print(f"An unexpected error occurred when trying to launch Gradio demo: {e}")