Martin van Dijk commited on
Commit ·
808c7ef
1
Parent(s): 40c4dc0
Update space
Browse files123451237456789101112151617181314import gradio as grfrom huggingface_hub import InferenceClient"""For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference"""from transformers import pipeline
model = InferenceClient("HuggingFaceH4/zephyr-7b-beta")model = pipeline("text-generation")
def predict(prompt): completion = model(prompt)[0]["generated_text"] return completion
import gradio as gr
"""For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface"""demo = gr.Interface(fn=predict, inputs="text", outputs="text").launch()gr.Interface(fn=predict, inputs="text", outputs="text").launch()
app.py+5-10