Spaces:
Runtime error
Runtime error
Download app.py from tmd-rahul/codegenerator: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/spaces/tmd-rahul/codegenerator/resolve/main/app.py
- Command line
-
hf download hf://spaces/tmd-rahul/codegenerator/app.py
-
curl -L -o app.py https://huggingface.co/spaces/tmd-rahul/codegenerator/resolve/main/app.py
504 Bytes
| from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline | |
| model_id = "deepseek-ai/DeepSeek-Coder-6.7B-Instruct" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto") | |
| pipe = pipeline("text-generation", model=model, tokenizer=tokenizer) | |
| prompt = "Add a custom field 'fabric_type' to product admin page in OpenCart and save it to database." | |
| result = pipe(prompt, max_new_tokens=400) | |
| print(result[0]['generated_text']) | |