Buckets:
| 'use client'; | |
| import { useEffect, useState } from 'react'; | |
| import { apiClient } from '@/utils/api'; | |
| export interface Settings { | |
| HF_TOKEN: string; | |
| TRAINING_FOLDER: string; | |
| DATASETS_FOLDER: string; | |
| MODELS_PATH: string; | |
| } | |
| export default function useSettings() { | |
| const [settings, setSettings] = useState({ | |
| HF_TOKEN: '', | |
| TRAINING_FOLDER: '', | |
| DATASETS_FOLDER: '', | |
| MODELS_PATH: '', | |
| }); | |
| const [isSettingsLoaded, setIsLoaded] = useState(false); | |
| useEffect(() => { | |
| apiClient | |
| .get('/api/settings') | |
| .then(res => res.data) | |
| .then(data => { | |
| console.log('Settings:', data); | |
| setSettings({ | |
| HF_TOKEN: data.HF_TOKEN || '', | |
| TRAINING_FOLDER: data.TRAINING_FOLDER || '', | |
| DATASETS_FOLDER: data.DATASETS_FOLDER || '', | |
| MODELS_PATH: data.MODELS_PATH || '', | |
| }); | |
| setIsLoaded(true); | |
| }) | |
| .catch(error => console.error('Error fetching settings:', error)); | |
| }, []); | |
| return { settings, setSettings, isSettingsLoaded }; | |
| } | |
Xet Storage Details
- Size:
- 1.03 kB
- Xet hash:
- c69149cb41a3b9e8a7e31f1d853fa4b1dd343fc9a1607549ed66176cb29d0d6a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.