|
import streamlit as st |
|
import requests |
|
|
|
|
|
API_URL = "https://api-inference.huggingface.co/models/tencent/Tencent-Hunyuan-Large" |
|
HF_API_KEY = st.secrets["HF_API_KEY"] |
|
|
|
def query(payload): |
|
headers = {"Authorization": f"Bearer {HF_API_KEY}"} |
|
response = requests.post(API_URL, headers=headers, json=payload) |
|
return response.json() |
|
|
|
|
|
st.title("Tencent-Hunyuan-Large Model Demo") |
|
user_input = st.text_input("Enter your text:", "") |
|
|
|
|
|
if st.button("Query Model"): |
|
|
|
payload = {"inputs": user_input} |
|
response = query(payload) |
|
st.write(response) |