Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import google.generativeai as palm
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
# Set your API key
|
5 |
+
palm.configure(api_key='PALM_KEY')
|
6 |
+
|
7 |
+
# Select the PaLM 2 model
|
8 |
+
model = 'models/text-bison-001'
|
9 |
+
|
10 |
+
# Generate text
|
11 |
+
prompt = "Write a poem about a cat."
|
12 |
+
completion = palm.generate_text(model=model, prompt=prompt, temperature=0.5, max_output_tokens=800)
|
13 |
+
|
14 |
+
# Print the generated text
|
15 |
+
st.write(completion.result)
|