Run this model with HF Jobs
Run SuperAGI/SAM on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/SuperAGI/SAM. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/SuperAGI/SAM on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/SuperAGI/SAM. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/SuperAGI/SAM. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use SuperAGI/SAM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SuperAGI/SAM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SuperAGI/SAM")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SuperAGI/SAM") model = AutoModelForCausalLM.from_pretrained("SuperAGI/SAM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SuperAGI/SAM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SuperAGI/SAM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SuperAGI/SAM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SuperAGI/SAM
- SGLang
How to use SuperAGI/SAM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SuperAGI/SAM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SuperAGI/SAM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SuperAGI/SAM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SuperAGI/SAM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SuperAGI/SAM with Docker Model Runner:
docker model run hf.co/SuperAGI/SAM
Commit ·
ce1fb6a
1
Parent(s): 5a0fc27
Update README.md
Browse files3 unmodified lines4567891011121314151623 unmodified lines4041424344454 unmodified lines505152535455565758591 unmodified line616263646566673 unmodified lines- en---# Model CardSAM (Small Agentic Model), a 7B model that demonstrates impressive reasoning abilities despite its smaller size. SAM-7B has outperformed existing SoTA models on various reasoning benchmarks, including GSM-8K and ARC-C.For full details of this model please read our [release blog post](https://superagi.com/introducing-sam-small-agentic-model/).# Key Contributions- SAM-7B outperforms GPT 3.5, Orca, and several other 70B models on multiple reasoning benchmarks, including ARC-C and GSM-8K.- Interestingly, despite being trained on a 97% smaller dataset, SAM-7B surpasses Orca-13B on GSM-8K.- All responses in our fine-tuning dataset are generated by open-source models without any assistance from state-of-the-art models like GPT-3.5 or GPT-4.## Training23 unmodified linesDespite being smaller in size, we show better multi-hop reasoning, as shown below:<img src = "https://superagi.com/wp-content/uploads/2023/12/image-932.png" alt="Reasoning Benchmark Performance" width="700">## Run the model```python4 unmodified linesmodel = AutoModelForCausalLM.from_pretrained(model_id)text = "Hello my name is"inputs = tokenizer(text, return_tensors="pt")outputs = model.generate(**inputs, max_new_tokens=20)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```1 unmodified line## LimitationsSAM is a demonstration that better reasoning can be induced using less but high-quality data generated using OpenSource LLMs.The model is not suitable for conversations and Q&A, it performs better in task breakdown and reasoning only.It does not have any moderation mechanisms. Therefore, the model is not suitable for production usage as it doesn't have guardrails for toxicity, societal bias, and language limitations. We would love to collaborate with the community to build safer and better models.## The SuperAGI AI Team3 unmodified lines4567891011121314151623 unmodified lines40414243444546474 unmodified lines525354555657585960611 unmodified line636465666768693 unmodified lines- en---# Model CardSAM (Small Agentic Model), a 7B model that demonstrates impressive reasoning abilities despite its smaller size. SAM-7B has outperformed existing SoTA models on various reasoning benchmarks, including GSM8k and ARC-C.For full details of this model please read our [release blog post](https://superagi.com/introducing-sam-small-agentic-model/).# Key Contributions- SAM-7B outperforms GPT 3.5, Orca, and several other 70B models on multiple reasoning benchmarks, including ARC-C and GSM8k.- Interestingly, despite being trained on a 97% smaller dataset, SAM-7B surpasses Orca-13B on GSM8k.- All responses in our fine-tuning dataset are generated by open-source models without any assistance from state-of-the-art models like GPT-3.5 or GPT-4.## Training23 unmodified linesDespite being smaller in size, we show better multi-hop reasoning, as shown below:<img src = "https://superagi.com/wp-content/uploads/2023/12/image-932.png" alt="Reasoning Benchmark Performance" width="700">Note: Temperature=0.3 is the suggested for optimal performance## Run the model```python4 unmodified linesmodel = AutoModelForCausalLM.from_pretrained(model_id)text = "Can elephants fly?"inputs = tokenizer(text, return_tensors="pt")outputs = model.generate(**inputs, max_new_tokens=200)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```1 unmodified line## LimitationsSAM is a demonstration that better reasoning can be induced using less but high-quality data generated using OpenSource LLMs.The model is not suitable for conversations and simple Q&A, it performs better in task breakdown and reasoning only.It does not have any moderation mechanisms. Therefore, the model is not suitable for production usage as it doesn't have guardrails for toxicity, societal bias, and language limitations. We would love to collaborate with the community to build safer and better models.## The SuperAGI AI Team
README.md+8-6