Spaces:
Build error
Build error
Commit
·
30e2b7a
1
Parent(s):
524a7b5
Update app.py
Browse files
app.py
CHANGED
@@ -150,9 +150,12 @@ def main():
|
|
150 |
st.title('Chat Toolkit')
|
151 |
api_key = st.sidebar.text_input("Enter OpenAI API Key:", type='password')
|
152 |
if api_key:
|
|
|
153 |
openai.api_key = api_key
|
|
|
|
|
154 |
|
155 |
-
st.session_state.text_content =
|
156 |
|
157 |
uploaded_file = st.sidebar.file_uploader("Add a file for context:", type=["xml", "json", "xlsx","csv","html", "htm", "md", "txt"])
|
158 |
max_length = st.sidebar.slider("File section length for large files", min_value=1000, max_value=128000, value=12000, step=1000)
|
@@ -207,7 +210,7 @@ def main():
|
|
207 |
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
208 |
# push transcript through as prompt
|
209 |
json_str2 = json.dumps(transcription, indent=4)
|
210 |
-
|
211 |
|
212 |
|
213 |
|
|
|
150 |
st.title('Chat Toolkit')
|
151 |
api_key = st.sidebar.text_input("Enter OpenAI API Key:", type='password')
|
152 |
if api_key:
|
153 |
+
|
154 |
openai.api_key = api_key
|
155 |
+
|
156 |
+
my_prompt = st.text_area("Enter prompts, instructions & questions:", '', height=100)
|
157 |
|
158 |
+
st.session_state.text_content = my_prompt
|
159 |
|
160 |
uploaded_file = st.sidebar.file_uploader("Add a file for context:", type=["xml", "json", "xlsx","csv","html", "htm", "md", "txt"])
|
161 |
max_length = st.sidebar.slider("File section length for large files", min_value=1000, max_value=128000, value=12000, step=1000)
|
|
|
210 |
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
211 |
# push transcript through as prompt
|
212 |
json_str2 = json.dumps(transcription, indent=4)
|
213 |
+
my_prompt.value = json_str2
|
214 |
|
215 |
|
216 |
|