bebechien commited on
Commit
c392892
·
verified ·
1 Parent(s): f012dc5

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. .gitignore +3 -0
  2. README.md +67 -1
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ __pycache__
2
+ artifacts
3
+
README.md CHANGED
@@ -12,5 +12,71 @@ license: apache-2.0
12
 
13
  # FunctionGemma Modkit
14
 
15
- This project provides a set of tools to fine-tune FunctionGemma to understand your personal needs.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
12
 
13
  # FunctionGemma Modkit
14
 
15
+ **FunctionGemma Modkit** is a user-friendly, Gradio-based interface designed to help you fine-tune [FunctionGemma](https://huggingface.co/google/functiongemma-270m-it) models to understand and utilize your specific custom tools and functions.
16
+
17
+ Whether you are building an agent to query internal knowledge bases, control smart home devices, or interact with proprietary APIs, this modkit streamlines the process of teaching the model your specific function schemas.
18
+
19
+ ##
20
+ Features
21
+
22
+ - **Interactive Tool Definition:** Define your function schemas (JSON) directly in the UI.
23
+ - **Custom Dataset Import:** Upload your own training data via CSV.
24
+ - **One-Click Fine-Tuning:** Configure hyperparameters (Epochs, Learning Rate) and start training with a single click.
25
+ - **Real-Time Monitoring:** Watch training logs and loss curves update in real-time.
26
+ - **Automatic Evaluation:** The system automatically evaluates the model's performance before and after training to show improvement.
27
+ - **Export Artifacts:** Download your fine-tuned model weights ready for deployment.
28
+
29
+ ##
30
+ Installation
31
+
32
+ 1. **Clone the repository:**
33
+ ```bash
34
+ hf download google/functiongemma-modkit --repo-type=space --local-dir=functiongemma-modkit
35
+ cd functiongemma-modkit
36
+ ```
37
+
38
+ 2. **Install dependencies:**
39
+ It is recommended to use a virtual environment.
40
+ ```bash
41
+ pip install -r requirements.txt
42
+ ```
43
+
44
+ ##
45
+ Usage
46
+
47
+ 1. **Set up Environment Variables (Optional):**
48
+ If you need to access gated models on Hugging Face, set your token:
49
+ ```bash
50
+ export HF_TOKEN=your_huggingface_token
51
+ ```
52
+
53
+ 2. **Run the Application:**
54
+ ```bash
55
+ python app.py
56
+ ```
57
+
58
+ 3. **Access the UI:**
59
+ Open your browser and navigate to the local URL provided in the terminal (usually `http://127.0.0.1:7860`).
60
+
61
+ ##
62
+ Data Format
63
+
64
+ To train on your own data, upload a CSV file with the following columns (no header required, or header ignored if present):
65
+
66
+ 1. **User Prompt:** The natural language query from the user.
67
+ 2. **Tool Name:** The name of the function that should be called.
68
+ 3. **Tool Arguments:** A JSON string representing the arguments for the function.
69
+
70
+ **Example CSV Row:**
71
+ ```csv
72
+ "What is the weather in London?", "get_weather", "{\"location\": \"London, UK\"}"
73
+ ```
74
+
75
+ ##
76
+ Configuration
77
+
78
+ Core settings can be modified in `config.py`:
79
+ - `MODEL_NAME`: Base model to fine-tune (default: `google/functiongemma-270m-it`).
80
+ - `DEFAULT_DATASET`: Hugging Face dataset to use if no custom CSV is uploaded.
81
+ - `ARTIFACTS_DIR`: Directory where training outputs are saved.
82