Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model:
|
3 |
+
- mistralai/Mistral-7B-Instruct-v0.2
|
4 |
+
pipeline_tag: question-answering
|
5 |
+
---
|
6 |
+
#Introduction
|
7 |
+
# SRED Analysis Model
|
8 |
+
|
9 |
+
This model is fine-tuned for analyzing SRED (Scientific Research and Experimental Development) content, specifically for Box 242 analysis.
|
10 |
+
|
11 |
+
## Usage
|
12 |
+
|
13 |
+
Example input format:
|
14 |
+
```json
|
15 |
+
{
|
16 |
+
"inputs": {
|
17 |
+
"messages": [
|
18 |
+
{
|
19 |
+
"role": "system",
|
20 |
+
"content": "You are an expert SRED technical writer analyzing Box 242 content."
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"role": "user",
|
24 |
+
"content": "Analyze the following technological uncertainties..."
|
25 |
+
}
|
26 |
+
]
|
27 |
+
},
|
28 |
+
"parameters": {
|
29 |
+
"temperature": 0.7,
|
30 |
+
"max_length": 1000
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
#Getting Started
|
35 |
+
##Activate Virtual Environment
|
36 |
+
python3 -m venv .venv
|
37 |
+
source .venv/bin/activate
|
38 |
+
pip install --upgrade pip
|
39 |
+
|
40 |
+
# Ensure virtual environment is activated for pip install upgrade, otherwise there may be conflicts with your global environment
|
41 |
+
|
42 |
+
#For M2 Silicon Apple Chip
|
43 |
+
##install in this exact order:
|
44 |
+
pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
|
45 |
+
pip install transformers==4.34.0
|
46 |
+
pip install datasets==2.14.0
|
47 |
+
pip install accelerate==0.24.0
|
48 |
+
pip install bitsandbytes==0.41.1
|
49 |
+
pip install wandb==0.15.12
|
50 |
+
pip install sentencepiece==0.1.99
|
51 |
+
|
52 |
+
##Finally install:
|
53 |
+
pip install peft==0.4.0
|
54 |
+
|
55 |
+
#For non-MX chips
|
56 |
+
##install in this order:
|
57 |
+
pip install transformers
|
58 |
+
pip install datasets
|
59 |
+
pip install accelerate
|
60 |
+
pip install bitsandbytes
|
61 |
+
pip install peft
|
62 |
+
pip install wandb
|
63 |
+
pip install torch
|
64 |
+
pip install sentencepiece
|
65 |
+
|
66 |
+
#For all users
|
67 |
+
pip install scipy
|
68 |
+
pip install easygui
|
69 |
+
pip install numpy==1.24.3
|
70 |
+
pip install python-dotenv
|
71 |
+
|
72 |
+
#Training setup
|
73 |
+
To create and upload required files to Hugging Face, run: python setup_files.py
|
74 |
+
To test your setup: run python test_setup.py
|
75 |
+
You will need to connect to WandB via WanB CLI
|
76 |
+
Update the .env file with your Hugging Face token, Hugging Face model name, and WandB token
|
77 |
+
The file should automatically push to Hugging Face
|
78 |
+
|
79 |
+
#Pushing just the model (no training)
|
80 |
+
If you need to just push the model, you can use: python push_model.py
|