Spaces:
Paused
Paused
Download app.py from ejschwartz/aidapal-space: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/spaces/ejschwartz/aidapal-space/resolve/3b930a242139b3818b8d54d1d79dbe699db2d763/app.py
- Command line
-
hf download hf://spaces/ejschwartz/aidapal-space@3b930a242139b3818b8d54d1d79dbe699db2d763/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ejschwartz/aidapal-space/resolve/3b930a242139b3818b8d54d1d79dbe699db2d763/app.py
536 Bytes
| import gradio as gr | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| model_id = "AverageBusinessUser/aidapal" | |
| filename = "aidapal-8k.Q4_K_M.gguf" | |
| #torch_dtype = torch.float32 # could be torch.float16 or torch.bfloat16 too | |
| tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=filename) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, gguf_file=filename, torch_dtype=torch_dtype) | |
| def greet(name): | |
| return "Hello " + name + "!!" | |
| demo = gr.Interface(fn=greet, inputs="text", outputs="text") | |
| demo.launch() |