hmb HF Staff commited on
Commit
55cd42e
·
1 Parent(s): 992f0a9

Fix Python 3.13 compatibility

Browse files

- Pin Python to 3.12
- Update SDK to Gradio 5.12.0
- Revert to Gradio 5.x compatible syntax

Files changed (2) hide show
  1. README.md +4 -3
  2. app.py +4 -4
README.md CHANGED
@@ -5,13 +5,14 @@ title: amethyst
5
  colorFrom: red
6
  colorTo: purple
7
  sdk: gradio
8
- sdk_version: 4.44.0
 
9
  app_file: app.py
10
  pinned: false
11
  license: apache-2.0
12
  ---
13
  # amethyst
14
  ## Description
15
- Add a description of this theme here!
16
  ## Contributions
17
- Thanks to [@hmb](https://huggingface.co/hmb) for adding this gradio theme!
 
5
  colorFrom: red
6
  colorTo: purple
7
  sdk: gradio
8
+ sdk_version: 5.12.0
9
+ python_version: "3.12"
10
  app_file: app.py
11
  pinned: false
12
  license: apache-2.0
13
  ---
14
  # amethyst
15
  ## Description
16
+ A beautiful purple/amethyst theme for Gradio apps.
17
  ## Contributions
18
+ Thanks to [@hmb](https://huggingface.co/hmb) for adding this gradio theme!
app.py CHANGED
@@ -2,7 +2,7 @@ import time
2
 
3
  import gradio as gr
4
 
5
- with gr.Blocks() as demo:
6
  with gr.Row(equal_height=True):
7
  with gr.Column(scale=10):
8
  gr.Markdown(
@@ -113,14 +113,14 @@ with gr.Blocks() as demo:
113
  with gr.Row():
114
  with gr.Column(scale=2):
115
  chatbot = gr.Chatbot(
116
- [{"role": "user", "content": "Hello"}, {"role": "assistant", "content": "Hi"}],
117
  label="Chatbot",
118
  )
119
  chat_btn = gr.Button("Add messages")
120
 
121
  chat_btn.click(
122
  lambda history: history
123
- + [{"role": "user", "content": "How are you?"}, {"role": "assistant", "content": "I am good."}]
124
  + (time.sleep(2) or []),
125
  chatbot,
126
  chatbot,
@@ -134,4 +134,4 @@ with gr.Blocks() as demo:
134
 
135
 
136
  if __name__ == "__main__":
137
- demo.queue().launch(theme="hmb/amethyst")
 
2
 
3
  import gradio as gr
4
 
5
+ with gr.Blocks(theme="hmb/amethyst") as demo:
6
  with gr.Row(equal_height=True):
7
  with gr.Column(scale=10):
8
  gr.Markdown(
 
113
  with gr.Row():
114
  with gr.Column(scale=2):
115
  chatbot = gr.Chatbot(
116
+ [("Hello", "Hi")],
117
  label="Chatbot",
118
  )
119
  chat_btn = gr.Button("Add messages")
120
 
121
  chat_btn.click(
122
  lambda history: history
123
+ + [("How are you?", "I am good.")]
124
  + (time.sleep(2) or []),
125
  chatbot,
126
  chatbot,
 
134
 
135
 
136
  if __name__ == "__main__":
137
+ demo.queue().launch()