Spaces:
Running
Running
Ley_Fill7
commited on
Commit
·
89f12f8
1
Parent(s):
59c83e1
Adjust the streamlit input part
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ import re
|
|
4 |
import streamlit as st
|
5 |
from langchain_nvidia_ai_endpoints import ChatNVIDIA
|
6 |
|
7 |
-
|
8 |
-
nvidia_api_key = os.
|
9 |
|
10 |
# Initialize ChatNVIDIA for text generation
|
11 |
client = ChatNVIDIA(
|
@@ -83,13 +83,11 @@ def generate(starting_text):
|
|
83 |
return response_end
|
84 |
|
85 |
# Streamlit UI
|
86 |
-
st.title("Generate MidJourney Prompts")
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
else:
|
95 |
-
st.warning("Please enter a starting text.")
|
|
|
4 |
import streamlit as st
|
5 |
from langchain_nvidia_ai_endpoints import ChatNVIDIA
|
6 |
|
7 |
+
# Set environmental variables
|
8 |
+
nvidia_api_key = os.getenv("NVIDIA_KEY")
|
9 |
|
10 |
# Initialize ChatNVIDIA for text generation
|
11 |
client = ChatNVIDIA(
|
|
|
83 |
return response_end
|
84 |
|
85 |
# Streamlit UI
|
86 |
+
st.title("Generate Sci-fi/Space-themed MidJourney Prompts")
|
87 |
+
|
88 |
+
user_input = st.text_input("Enter a starting text or just press Generate to get a space-themed prompt:")
|
89 |
+
|
90 |
+
if st.button("Generate Prompt"):
|
91 |
+
generated_prompt = generate(user_input)
|
92 |
+
st.write("**MidJourney Prompt:**")
|
93 |
+
st.write(generated_prompt)
|
|
|
|