Update main.py
Browse files
main.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
with gr.Blocks() as demo:
|
4 |
-
gr.Markdown(
|
5 |
|
6 |
demo.queue().launch(server_name="0.0.0.0", server_port=3000)
|
|
|
1 |
import gradio as gr
|
2 |
+
from text_generation import Client
|
3 |
+
|
4 |
+
endpoint_url = "https://127.0.0.1:8080"
|
5 |
+
client = Client(endpoint_url)
|
6 |
+
|
7 |
+
text = client.generate("Why is the sky blue?").generated_text
|
8 |
+
print(text)
|
9 |
|
10 |
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown(text)
|
12 |
|
13 |
demo.queue().launch(server_name="0.0.0.0", server_port=3000)
|