import gradio as gr from huggingface_hub import InferenceApi # point to the base model with no instruction tuning or filters api = InferenceApi( repo_id="EleutherAI/gpt-neo-1.3B", task="text-generation" ) def respond(prompt): try: outputs = api(inputs=prompt, parameters={"max_new_tokens":200, "temperature":0.7}) return outputs[0].get("generated_text", "[error] no text returned") except Exception as e: return f"[exception] {e}" gr.Interface( fn=respond, inputs=gr.Textbox(lines=3, placeholder="type anything…"), outputs="text", title="uncensored gpt-neo-1.3B chat" ).launch(server_name="0.0.0.0", server_port=7860)