Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Load the model
|
4 |
+
model_interface = gr.load("models/google/gemma-2-2b-it")
|
5 |
+
|
6 |
+
# Create a Gradio interface with custom title and logo
|
7 |
+
def main():
|
8 |
+
with gr.Blocks() as demo:
|
9 |
+
# Add the title
|
10 |
+
gr.Markdown("# Gemma 2b Demo")
|
11 |
+
|
12 |
+
# Add the logo
|
13 |
+
gr.Image("orYx logo.png", elem_id="logo", show_label=False, interactive=False)
|
14 |
+
|
15 |
+
# Embed the model interface inside a Row
|
16 |
+
with gr.Row():
|
17 |
+
model_interface.render() # Use render to include the prebuilt interface
|
18 |
+
|
19 |
+
demo.launch()
|
20 |
+
|
21 |
+
if __name__ == "__main__":
|
22 |
+
main()
|