Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import vertexai
|
|
4 |
from vertexai.generative_models import GenerativeModel
|
5 |
import vertexai.preview.generative_models as generative_models
|
6 |
import gradio as gr
|
7 |
-
import
|
8 |
|
9 |
# Read the service account key JSON file path from environment variable
|
10 |
SERVICE_ACCOUNT_KEY_PATH = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")
|
@@ -105,14 +105,14 @@ with gr.Blocks() as demo:
|
|
105 |
with gr.Row():
|
106 |
with gr.Column(scale=2):
|
107 |
input_text = gr.Textbox(lines=2, placeholder="Enter text here...")
|
108 |
-
output_text =
|
109 |
generate_button = gr.Button("Submit")
|
110 |
-
copy_button = gr.Button("Copy Output Text")
|
111 |
|
112 |
# paste_text = gr.Text(pyperclip.paste())
|
113 |
|
114 |
generate_button.click(generate, inputs=input_text, outputs=output_text)
|
115 |
-
copy_button.click(pyperclip.copy(output_text))
|
116 |
|
117 |
|
118 |
demo.launch()
|
|
|
4 |
from vertexai.generative_models import GenerativeModel
|
5 |
import vertexai.preview.generative_models as generative_models
|
6 |
import gradio as gr
|
7 |
+
import streamlit as st
|
8 |
|
9 |
# Read the service account key JSON file path from environment variable
|
10 |
SERVICE_ACCOUNT_KEY_PATH = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")
|
|
|
105 |
with gr.Row():
|
106 |
with gr.Column(scale=2):
|
107 |
input_text = gr.Textbox(lines=2, placeholder="Enter text here...")
|
108 |
+
output_text = st.code
|
109 |
generate_button = gr.Button("Submit")
|
110 |
+
# copy_button = gr.Button("Copy Output Text")
|
111 |
|
112 |
# paste_text = gr.Text(pyperclip.paste())
|
113 |
|
114 |
generate_button.click(generate, inputs=input_text, outputs=output_text)
|
115 |
+
# copy_button.click(pyperclip.copy(output_text))
|
116 |
|
117 |
|
118 |
demo.launch()
|