Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,6 +20,8 @@ os.environ["TRAINER_TELEMETRY"]= "0"
|
|
| 20 |
# Constants
|
| 21 |
|
| 22 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Set the device to GPU or CPU
|
| 25 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
@@ -194,14 +196,14 @@ with rl:
|
|
| 194 |
st.error("Please record audio or upload a file to transcribe.")
|
| 195 |
|
| 196 |
# End of Box 3 and third Carousel Item
|
| 197 |
-
st.markdown('''<h3><i class="fa fa-pencil"></i>
|
| 198 |
with right:
|
| 199 |
# Box 4: Form 3
|
| 200 |
prompt3 = st.text_input("Enter Prompt", key="prompt3")
|
| 201 |
-
image_url3 = st.text_input("Enter Image URL", key="image_url3")
|
| 202 |
if st.button("Submit Form 3", key="submit3"):
|
| 203 |
-
payload = {"prompt": prompt3
|
| 204 |
-
response = requests.post("
|
| 205 |
if response.status_code == 200:
|
| 206 |
st.write(f"**Response:** {response.json().get('response', 'No response')}")
|
| 207 |
else:
|
|
|
|
| 20 |
# Constants
|
| 21 |
|
| 22 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
| 23 |
+
BASETEN_API = os.environ.get("BASETEN_API", None)
|
| 24 |
+
BASETEN_KEY = os.environ.get("BASETEN_KEY", None)
|
| 25 |
|
| 26 |
# Set the device to GPU or CPU
|
| 27 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 196 |
st.error("Please record audio or upload a file to transcribe.")
|
| 197 |
|
| 198 |
# End of Box 3 and third Carousel Item
|
| 199 |
+
st.markdown('''<h3><i class="fa fa-pencil"></i> Chat with Mistral</h3>''', unsafe_allow_html=True)
|
| 200 |
with right:
|
| 201 |
# Box 4: Form 3
|
| 202 |
prompt3 = st.text_input("Enter Prompt", key="prompt3")
|
| 203 |
+
#image_url3 = st.text_input("Enter Image URL", key="image_url3")
|
| 204 |
if st.button("Submit Form 3", key="submit3"):
|
| 205 |
+
payload = {"prompt": prompt3}
|
| 206 |
+
response = requests.post("{BASETEN_API}", headers={"Authorization": "Api-Key {BASETEN_KEY}"}, json=payload)
|
| 207 |
if response.status_code == 200:
|
| 208 |
st.write(f"**Response:** {response.json().get('response', 'No response')}")
|
| 209 |
else:
|