Text Generation
Transformers
Safetensors
PyTorch
English
llama
python
java
cpp
sql
function calling
unit tests
causalLM
codeLLAMA modified archi
document
code
code2doc
instruction_tuned
basemodel
docstring
documentation
text-generation-inference
plan
planner
conversational
Instructions to use PipableAI/pip-code-bandit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PipableAI/pip-code-bandit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PipableAI/pip-code-bandit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-code-bandit") model = AutoModelForCausalLM.from_pretrained("PipableAI/pip-code-bandit") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PipableAI/pip-code-bandit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PipableAI/pip-code-bandit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PipableAI/pip-code-bandit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PipableAI/pip-code-bandit
- SGLang
How to use PipableAI/pip-code-bandit 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 "PipableAI/pip-code-bandit" \ --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": "PipableAI/pip-code-bandit", "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 "PipableAI/pip-code-bandit" \ --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": "PipableAI/pip-code-bandit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PipableAI/pip-code-bandit with Docker Model Runner:
docker model run hf.co/PipableAI/pip-code-bandit
Upload LlamaForCausalLM
Browse files- README.md +12 -2
- config.json +1 -1
README.md
CHANGED
|
@@ -15,7 +15,7 @@ tags:
|
|
| 15 |
- function calling
|
| 16 |
- unit tests
|
| 17 |
- causalLM
|
| 18 |
-
- codeLLAMA
|
| 19 |
- instruction_tuned
|
| 20 |
- basemodel
|
| 21 |
- pytorch
|
|
@@ -26,7 +26,17 @@ metrics:
|
|
| 26 |
- accuracy
|
| 27 |
pipeline_tag: text-generation
|
| 28 |
widget:
|
| 29 |
-
- text: '<function_code>def _plot_bounding_polygon(polygons_coordinates, output_html_path=bounding_polygon_map.html):map_center
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
example_title: example
|
| 31 |
---
|
| 32 |
# pip-library-etl-1.3b
|
|
|
|
| 15 |
- function calling
|
| 16 |
- unit tests
|
| 17 |
- causalLM
|
| 18 |
+
- codeLLAMA
|
| 19 |
- instruction_tuned
|
| 20 |
- basemodel
|
| 21 |
- pytorch
|
|
|
|
| 26 |
- accuracy
|
| 27 |
pipeline_tag: text-generation
|
| 28 |
widget:
|
| 29 |
+
- text: '<function_code>def _plot_bounding_polygon(polygons_coordinates, output_html_path=bounding_polygon_map.html):map_center
|
| 30 |
+
= [sum([coord[0]for polygon_coords in polygons_coordinatesfor coord in polygon_coords])/
|
| 31 |
+
sum([len(polygon_coords) for polygon_coords in polygons_coordinates]),sum([coord[1]for
|
| 32 |
+
polygon_coords in polygons_coordinatesfor coord in polygon_coords])/ sum([len(polygon_coords)
|
| 33 |
+
for polygon_coords in polygons_coordinates]),]my_map = folium.Map(location=map_center,
|
| 34 |
+
zoom_start=12)for polygon_coords in polygons_coordinates:folium.Polygon(locations=polygon_coords,color=blue,fill=True,fill_color=blue,fill_opacity=0.2,).add_to(my_map)marker_cluster
|
| 35 |
+
= MarkerCluster().add_to(my_map)for polygon_coords in polygons_coordinates:for
|
| 36 |
+
coord in polygon_coords:folium.Marker(location=[coord[0], coord[1]], popup=fCoordinates:
|
| 37 |
+
{coord}).add_to(marker_cluster)draw = Draw(export=True)draw.add_to(my_map)my_map.save(output_html_path)return
|
| 38 |
+
output_html_path</function_code><question>Document the python code above giving
|
| 39 |
+
function description ,parameters and return type and example how to call the function</question><doc>'
|
| 40 |
example_title: example
|
| 41 |
---
|
| 42 |
# pip-library-etl-1.3b
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "PipableAI/pip-code-bandi-testv1",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|