Text Generation
Transformers
PyTorch
English
gpt_bigcode
langchain
python
yolov8
vertexai
text-generation-inference
Instructions to use iterateai/Interplay-AppCoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iterateai/Interplay-AppCoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iterateai/Interplay-AppCoder")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("iterateai/Interplay-AppCoder") model = AutoModelForCausalLM.from_pretrained("iterateai/Interplay-AppCoder") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use iterateai/Interplay-AppCoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iterateai/Interplay-AppCoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iterateai/Interplay-AppCoder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/iterateai/Interplay-AppCoder
- SGLang
How to use iterateai/Interplay-AppCoder 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 "iterateai/Interplay-AppCoder" \ --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": "iterateai/Interplay-AppCoder", "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 "iterateai/Interplay-AppCoder" \ --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": "iterateai/Interplay-AppCoder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use iterateai/Interplay-AppCoder with Docker Model Runner:
docker model run hf.co/iterateai/Interplay-AppCoder
Update README.md
Browse files
README.md
CHANGED
|
@@ -34,60 +34,89 @@ The result is Interplay-AppCoder LLM, a brand new high performing code generatio
|
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
-
- **Demo
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
## Bias, Risks, and Limitations
|
| 42 |
|
| 43 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
|
|
|
| 44 |
|
| 45 |
-
[More Information Needed]
|
| 46 |
-
|
| 47 |
-
### Recommendations
|
| 48 |
-
|
| 49 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 50 |
-
|
| 51 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 52 |
|
| 53 |
## How to Get Started with the Model
|
| 54 |
|
| 55 |
Use the code below to get started with the model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
## Training Details
|
| 60 |
-
|
| 61 |
-
### Training Data
|
| 62 |
-
|
| 63 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
###
|
| 68 |
|
| 69 |
-
<!-- This
|
| 70 |
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
-
##
|
| 74 |
|
| 75 |
-
<!--
|
|
|
|
| 76 |
|
| 77 |
-
|
| 78 |
|
| 79 |
-
|
|
|
|
| 80 |
|
| 81 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 82 |
|
| 83 |
-
[
|
| 84 |
|
|
|
|
| 85 |
|
| 86 |
-
|
| 87 |
|
| 88 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 89 |
|
| 90 |
-
[More Information Needed]
|
| 91 |
|
| 92 |
|
| 93 |
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
+
- **Demo :** [https://appcoder.interplay.iterate.ai/]
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
## Bias, Risks, and Limitations
|
| 42 |
|
| 43 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 44 |
+
The model is optimized for code generation and cannot be used as chat model.
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
## How to Get Started with the Model
|
| 48 |
|
| 49 |
Use the code below to get started with the model.
|
| 50 |
+
#import model from hugging face repository
|
| 51 |
+
import torch
|
| 52 |
+
from transformers import (
|
| 53 |
+
AutoModelForCausalLM,
|
| 54 |
+
AutoTokenizer,
|
| 55 |
+
BitsAndBytesConfig,
|
| 56 |
+
HfArgumentParser,
|
| 57 |
+
pipeline,
|
| 58 |
+
logging
|
| 59 |
+
)
|
| 60 |
+
model_repo_id ="iterateai/Interplay-AppCoder"
|
| 61 |
+
|
| 62 |
+
#### Load the model in FP16
|
| 63 |
+
iterate_model = AutoModelForCausalLM.from_pretrained(
|
| 64 |
+
model_repo_id,
|
| 65 |
+
low_cpu_mem_usage=True,
|
| 66 |
+
return_dict=True,
|
| 67 |
+
torch_dtype=torch.float16,
|
| 68 |
+
device_map={"": 0},
|
| 69 |
+
trust_remote_code=True
|
| 70 |
+
)
|
| 71 |
+
#Note: You can quantize the model using bnb confi parameter to load the model in T4 GPU
|
| 72 |
+
|
| 73 |
+
### Load tokenizer to save it
|
| 74 |
+
tokenizer = AutoTokenizer.from_pretrained(model_repo_id, trust_remote_code=True)
|
| 75 |
+
tokenizer.pad_token = tokenizer.eos_token
|
| 76 |
+
tokenizer.padding_side = "right"
|
| 77 |
+
|
| 78 |
+
### Inferencing
|
| 79 |
+
|
| 80 |
+
logging.set_verbosity(logging.CRITICAL)
|
| 81 |
+
#### Sample prompt
|
| 82 |
+
prompt = "Can you provide a python script that uses the YOLOv8 model from the Ultralytics library to detect people in an image, draw green bounding boxes around them, and then save the image?"
|
| 83 |
+
|
| 84 |
+
pipe = pipeline(task="text-generation", model=iterate_model, tokenizer=tokenizer, max_length=1024)
|
| 85 |
+
result = pipe(f"Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: {prompt} ### Response:",temperature=0.1,do_sample=True)
|
| 86 |
+
print(result[0]['generated_text'])
|
| 87 |
+
|
| 88 |
+
## Sample demo notebook
|
| 89 |
+
[https://colab.research.google.com/drive/1USuNLFxLex-C5tLHYET_nQfpM4ALCbc5?usp=sharing#scrollTo=lNCZTBj1nBsJ]
|
| 90 |
|
| 91 |
+
## Evaluation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 94 |
|
| 95 |
+
#### Testing Data
|
| 96 |
|
| 97 |
+
<!-- This should link to a Dataset Card if possible. -->
|
| 98 |
|
| 99 |
+
Dataset used for evaluation [https://drive.google.com/file/d/1R6DDyBhcR6TSUYFTgUosJxrvibkR1BHC/view]
|
| 100 |
|
| 101 |
|
| 102 |
+
#### Metrics
|
| 103 |
|
| 104 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 105 |
+
Our CodeGeneration LLM was created and fine-tuned with a new and unique knowledge base. As such, we utilized the newly published ICE score benchmark methodology for evaluating the code generated by the Interplay-AppCoder LLM.
|
| 106 |
|
| 107 |
+
The ICE methodology provides metrics for Usefulness and Functional Correctness as a baseline for scoring code generation.
|
| 108 |
|
| 109 |
+
* Usefulness: addresses whether the code output from the model is clear, presented in logical order, and maintains human readability and whether it covers all functionalities of the problem statement after comparing it with the reference code.
|
| 110 |
+
* Functional Correctness: An LLM that has complex reasoning capabilities is utilized to conduct unit tests while considering the given question and the reference code.
|
| 111 |
|
|
|
|
| 112 |
|
| 113 |
+
We utilized GPT4 to measure the above metrics and provide a score from 0-4. This is the test dataset[https://drive.google.com/file/d/1R6DDyBhcR6TSUYFTgUosJxrvibkR1BHC/view] and Jupyter notebook [https://colab.research.google.com/drive/1USuNLFxLex-C5tLHYET_nQfpM4ALCbc5?usp=sharing#scrollTo=lNCZTBj1nBsJ] we used to perform the benchmark.
|
| 114 |
|
| 115 |
+
You can read more about the ICE methodology in this paper.
|
| 116 |
|
| 117 |
+
[https://openreview.net/pdf?id=RoGZaCsGUW]
|
| 118 |
|
|
|
|
| 119 |
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
|