Spaces:
Running
Running
File size: 778 Bytes
2b8006e e4d6971 2b8006e e4d6971 2b8006e e4d6971 2b8006e e4d6971 2b8006e e4d6971 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from huggingface_hub import InferenceApi
# public repo, no token needed
api = InferenceApi(
repo_id="bartowski/cognitivecomputations_Dolphin-Mistral-24B-Venice-Edition-GGUF",
task="text-generation"
)
def respond(prompt):
# send the prompt, get back a list of dicts
outputs = api(inputs=prompt, parameters={"max_new_tokens":200, "temperature":0.7})
# the API returns e.g. [{"generated_text": "..."}]
return outputs[0]["generated_text"]
gr.Interface(
fn=respond,
inputs=gr.Textbox(lines=3, placeholder="ask me anything…"),
outputs="text",
title="Dolphin-Mistral-24B via Inference API",
description="Powered by the HF Inference API—no local model load needed."
).launch(server_name="0.0.0.0", server_port=7860) |