Text Generation
Transformers
PyTorch
English
gpt_neox
code
knowledge extraction
tiny
small
C
text-generation-inference
Instructions to use Mxode/Pythia-70m-C-Language-KnowledgeExtract with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mxode/Pythia-70m-C-Language-KnowledgeExtract with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mxode/Pythia-70m-C-Language-KnowledgeExtract")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mxode/Pythia-70m-C-Language-KnowledgeExtract") model = AutoModelForCausalLM.from_pretrained("Mxode/Pythia-70m-C-Language-KnowledgeExtract") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Mxode/Pythia-70m-C-Language-KnowledgeExtract with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mxode/Pythia-70m-C-Language-KnowledgeExtract" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mxode/Pythia-70m-C-Language-KnowledgeExtract", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Mxode/Pythia-70m-C-Language-KnowledgeExtract
- SGLang
How to use Mxode/Pythia-70m-C-Language-KnowledgeExtract 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 "Mxode/Pythia-70m-C-Language-KnowledgeExtract" \ --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": "Mxode/Pythia-70m-C-Language-KnowledgeExtract", "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 "Mxode/Pythia-70m-C-Language-KnowledgeExtract" \ --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": "Mxode/Pythia-70m-C-Language-KnowledgeExtract", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Mxode/Pythia-70m-C-Language-KnowledgeExtract with Docker Model Runner:
docker model run hf.co/Mxode/Pythia-70m-C-Language-KnowledgeExtract
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,11 +7,20 @@ tags:
|
|
| 7 |
- knowledge extraction
|
| 8 |
- tiny
|
| 9 |
- small
|
|
|
|
| 10 |
---
|
|
|
|
|
|
|
| 11 |
A model that can **extract the knowledge points** from the given **C language code**.
|
| 12 |
|
| 13 |
The base model is [pythia-70m](https://huggingface.co/EleutherAI/pythia-70m). This model was fine-tuned with 10 epochs using [Q-Lora](https://github.com/artidoro/qlora) method on my own training set.
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
A usage example is as follows, first import the model and prepare the code:
|
| 16 |
|
| 17 |
```python
|
|
@@ -66,6 +75,8 @@ response = tokenizer.decode(tokens[0]).split('```')[-1].split('<')[0]
|
|
| 66 |
|
| 67 |
|
| 68 |
|
|
|
|
|
|
|
| 69 |
However, in practical use, in order to achieve more diverse representations, it's recommended to do multiple inferences. Don't worry, it's really small so the inferences don't take much time, as follows:
|
| 70 |
|
| 71 |
```python
|
|
@@ -95,5 +106,5 @@ print(ans_dict)
|
|
| 95 |
### 'Quick sort': 25,
|
| 96 |
### 'Recurrence': 2,
|
| 97 |
### 'Queue': 1
|
| 98 |
-
###}
|
| 99 |
```
|
|
|
|
| 7 |
- knowledge extraction
|
| 8 |
- tiny
|
| 9 |
- small
|
| 10 |
+
- C
|
| 11 |
---
|
| 12 |
+
## Model info
|
| 13 |
+
|
| 14 |
A model that can **extract the knowledge points** from the given **C language code**.
|
| 15 |
|
| 16 |
The base model is [pythia-70m](https://huggingface.co/EleutherAI/pythia-70m). This model was fine-tuned with 10 epochs using [Q-Lora](https://github.com/artidoro/qlora) method on my own training set.
|
| 17 |
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
## How to use
|
| 21 |
+
|
| 22 |
+
### quick start
|
| 23 |
+
|
| 24 |
A usage example is as follows, first import the model and prepare the code:
|
| 25 |
|
| 26 |
```python
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
+
### and more
|
| 79 |
+
|
| 80 |
However, in practical use, in order to achieve more diverse representations, it's recommended to do multiple inferences. Don't worry, it's really small so the inferences don't take much time, as follows:
|
| 81 |
|
| 82 |
```python
|
|
|
|
| 106 |
### 'Quick sort': 25,
|
| 107 |
### 'Recurrence': 2,
|
| 108 |
### 'Queue': 1
|
| 109 |
+
### }
|
| 110 |
```
|