Spaces:
Sleeping
Sleeping
Update app.py
Browse files1234456789108910import gradio as grfrom huggingface_hub import InferenceClient
themes=["Pick a Genre", "thriller", "fantasy", "romance", "sci-fi", "mystery", "fiction", "Spanish"]themes=["Pick a Genre", "thriller", "fantasy", "romance", "sci-fi", "mystery", "fiction"]
def reaction(text, theme): modelName= 'HuggingFaceH4/zephyr-7b-beta' match theme: case "Spanish": modelName='DeepESP/gpt2-spanish' thiscontent=f'Give only one {theme} response to this statement: {text}?' messages=[{'role': 'user', 'content': thiscontent}] client=InferenceClient(model=modelName)app.py+1-4