Spaces:
Sleeping
Sleeping
File size: 660 Bytes
cbcce33 4dc806b cbcce33 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import streamlit as st
import os
import requests
HF_API_URL = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta"
HF_API_TOKEN = os.getenv("HF_API_TOKEN")
headers = {"Authorization": f"Bearer {HF_API_TOKEN}"}
st.title("Missed Call AI Assistant")
user_input = st.text_input("Enter message:")
if st.button("Get Response"):
if user_input:
payload = {"inputs": user_input}
response = requests.post(HF_API_URL, headers=headers, json=payload)
if response.status_code == 200:
st.write("AI Response:", response.json()[0]['generated_text'])
else:
st.write("Error:", response.text)
|