Spaces:
Sleeping
Sleeping
import requests | |
import gradio as gr | |
API_URL = "https://api-inference.huggingface.co/models/project-baize/baize-v2-7b" | |
headers = {"Authorization": "Bearer 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"} | |
def query(txt): | |
payload = {'inputs' : txt} | |
response = requests.post(API_URL, headers=headers, json=payload) | |
return response.json() | |
gr.Interface(fn=query, inputs='text', outputs = 'text').launch() |