Instructions to use reshinthadith/local-repo-coder-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use reshinthadith/local-repo-coder-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="reshinthadith/local-repo-coder-v0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("reshinthadith/local-repo-coder-v0") model = AutoModelForCausalLM.from_pretrained("reshinthadith/local-repo-coder-v0", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use reshinthadith/local-repo-coder-v0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "reshinthadith/local-repo-coder-v0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "reshinthadith/local-repo-coder-v0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/reshinthadith/local-repo-coder-v0
- SGLang
How to use reshinthadith/local-repo-coder-v0 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 "reshinthadith/local-repo-coder-v0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "reshinthadith/local-repo-coder-v0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "reshinthadith/local-repo-coder-v0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "reshinthadith/local-repo-coder-v0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use reshinthadith/local-repo-coder-v0 with Docker Model Runner:
docker model run hf.co/reshinthadith/local-repo-coder-v0
Download example.txt from reshinthadith/local-repo-coder-v0: direct link, hf CLI and curl.
- Browser
- Download file 2.5 kB
-
https://huggingface.co/reshinthadith/local-repo-coder-v0/resolve/main/example.txt
- Command line
-
hf download hf://reshinthadith/local-repo-coder-v0/example.txt
-
curl -L -o example.txt https://huggingface.co/reshinthadith/local-repo-coder-v0/resolve/main/example.txt
2.5 kB
| ###Instruction: Generate a small python repo for matplotlib to visualize timeseries data to read from timeseries.csv file using polars. | |
| ###Response: The repository should include the following: | |
| - A `src` directory for the Python source files. | |
| - A `data` directory for the input CSV file. | |
| - A `requirements.txt` file listing the necessary libraries. | |
| - A `README.md` file explaining how to use the tool. | |
| - A `run.sh` script to execute the main program. | |
| Create the repository structure and populate it with the necessary files. ```python | |
| <libs>matplotlib,polars</libs> | |
| <planning> | |
| #1 Create the repository structure. | |
| - Initialize the git repository. | |
| - Create the `src`, `data`, and `docs` directories. | |
| #2 Populate the repository with necessary files. | |
| - Add a `requirements.txt` file with the necessary libraries. | |
| - Add a `README.md` file explaining how to use the tool. | |
| - Add a `run.sh` script to execute the main program. | |
| - Add a Python script in `src` to visualize timeseries data. | |
| </planning> | |
| <requirements>matplotlib==3.5.1 | |
| polars==0.17.0</requirements> | |
| <output><file1>src/visualize_timeseries.py<content> | |
| import polars as pl | |
| import matplotlib.pyplot as plt | |
| def load_timeseries_data(file_path): | |
| """Load timeseries data from a CSV file.""" | |
| return pl.read_csv(file_path, has_headers=True) | |
| def visualize_timeseries(data): | |
| """Visualize the timeseries data.""" | |
| plt.figure(figsize=(10, 6)) | |
| plt.plot(data['timestamp'], data['value'], label='Timeseries Data') | |
| plt.xlabel('Timestamp') | |
| plt.ylabel('Value') | |
| plt.title('Timeseries Visualization') | |
| plt.legend() | |
| plt.grid(True) | |
| plt.show() | |
| if __name__ == "__main__": | |
| file_path = 'data/timeseries.csv' | |
| data = load_timeseries_data(file_path) | |
| visualize_timeseries(data) | |
| </content></file1> | |
| <bashfile>run.sh<content>python3 src/visualize_timeseries.py</content></bashfile> | |
| <readme>README.md<content> | |
| # Timeseries Visualization Tool | |
| This tool visualizes timeseries data loaded from a CSV file using `pandas` for data handling and `matplotlib` for plotting. | |
| ## Requirements | |
| Ensure you have the following libraries installed: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ## Usage | |
| To run the visualization tool, execute the following command: | |
| ```bash | |
| bash run.sh | |
| ``` | |
| ## Data | |
| The tool expects a CSV file named `timeseries.csv` in the `data` directory with the following columns: | |
| - `timestamp`: Timestamp of the data point. | |
| - `value`: Value of the timeseries data. | |
| </content></readme> | |
| </output> |