uniAIDevs / ai

🌈 A Reliable Open Source AI studio - Core infrastructure stack for building your AI workforce
https://www.missing.studio
Apache License 2.0
0 stars 0 forks source link

Sweep: Add feature for LLM finetuning from HuggingFace (transformer models only) #5

Open uniAIDevs opened 3 months ago

uniAIDevs commented 3 months ago
Checklist - [X] Create `gateway/internal/provider/huggingface/huggingface.go` ✓ https://github.com/uniAIDevs/ai/commit/60911bdcddb9e8d725b85d2cf0f8421262fce932 [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/gateway/internal/provider/huggingface/huggingface.go) - [X] Running GitHub Actions for `gateway/internal/provider/huggingface/huggingface.go` ✓ [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/gateway/internal/provider/huggingface/huggingface.go) - [X] Create `gateway/internal/api/v1/finetune.go` ✓ https://github.com/uniAIDevs/ai/commit/82f55933d34ab4ae641421256a30790d745a3cfd [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/gateway/internal/api/v1/finetune.go) - [X] Running GitHub Actions for `gateway/internal/api/v1/finetune.go` ✓ [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/gateway/internal/api/v1/finetune.go) - [X] Modify `gateway/internal/api/v1/v1.go` ! No changes made [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/gateway/internal/api/v1/v1.go) - [X] Running GitHub Actions for `gateway/internal/api/v1/v1.go` ✗ [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/gateway/internal/api/v1/v1.go) - [X] Modify `playgrounds/apps/studio/app/(llm)/playground/hooks/useModelFetch.tsx` ✓ https://github.com/uniAIDevs/ai/commit/3f04b91788cb909b639228a1376a27f2ebcfa2cf [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/playgrounds/apps/studio/app/(llm)/playground/hooks/useModelFetch.tsx) - [X] Running GitHub Actions for `playgrounds/apps/studio/app/(llm)/playground/hooks/useModelFetch.tsx` ✓ [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/playgrounds/apps/studio/app/(llm)/playground/hooks/useModelFetch.tsx) - [X] Modify `playgrounds/apps/studio/app/(llm)/playground/components/modelselector.tsx` ✓ https://github.com/uniAIDevs/ai/commit/bd0d2375e35ba4f7425000471c68d136c3864e24 [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/playgrounds/apps/studio/app/(llm)/playground/components/modelselector.tsx) - [X] Running GitHub Actions for `playgrounds/apps/studio/app/(llm)/playground/components/modelselector.tsx` ✓ [Edit](https://github.com/uniAIDevs/ai/edit/sweep/add_feature_for_llm_finetuning_from_hugg/playgrounds/apps/studio/app/(llm)/playground/components/modelselector.tsx)
sweep-ai[bot] commented 3 months ago

🚀 Here's the PR! #7

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: d4678992ac)
Install Sweep Configs: Pull Request

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/uniAIDevs/ai/blob/dd9f74f42104b7ab768064c2178ed970854442d8/gateway/internal/provider/openai/openai.go#L1-L123 https://github.com/uniAIDevs/ai/blob/dd9f74f42104b7ab768064c2178ed970854442d8/gateway/internal/api/v1/models.go#L1-L46 https://github.com/uniAIDevs/ai/blob/dd9f74f42104b7ab768064c2178ed970854442d8/playgrounds/apps/studio/app/(llm)/playground/hooks/useModelFetch.tsx#L1-L38 https://github.com/uniAIDevs/ai/blob/dd9f74f42104b7ab768064c2178ed970854442d8/playgrounds/apps/studio/app/(llm)/playground/components/modelselector.tsx#L1-L73

Step 2: ⌨️ Coding

Ran GitHub Actions for 60911bdcddb9e8d725b85d2cf0f8421262fce932:

Ran GitHub Actions for 82f55933d34ab4ae641421256a30790d745a3cfd:

--- 
+++ 
@@ -14,11 +14,13 @@
 const BASE_URL = process.env.NEXT_PUBLIC_GATEWAY_URL ?? "http://localhost:3000";
 export function useModelFetch() {
   const [providers, setProviders] = useState([]);
+const [isFineTuning, setIsFineTuning] = useState(false);

   useEffect(() => {
+    const fetchEndpoint = isFineTuning ? `${BASE_URL}/api/v1/finetune/models` : `${BASE_URL}/api/v1/models`;
     async function fetchModels() {
       try {
-        const response = await fetch(`${BASE_URL}/api/v1/models`);
+        const response = await fetch(fetchEndpoint);
         const { models } = await response.json();
         const fetchedProviders: ModelType[] = Object.keys(models).map(
           (key) => ({

Ran GitHub Actions for 3f04b91788cb909b639228a1376a27f2ebcfa2cf:

--- 
+++ 
@@ -26,12 +26,18 @@

 export default function ModelSelector(props: ModelSelectorProps) {
   const [open, setOpen] = React.useState(false);
-  const { providers } = useModelFetch();
+  const [isFineTuning, setIsFineTuning] = React.useState(false);
+  const { providers } = useModelFetch(isFineTuning);
   const { model, setModel, setProvider } = useStore();
+
+  const toggleFineTuning = () => setIsFineTuning(!isFineTuning);

   return (
     
+
codeautopilot[bot] commented 3 months ago

Your organization has reached the subscribed usage limit. You can upgrade your account by purchasing a subscription at Stripe payment link

_Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect._ Current plan usage: 101.35% **Have feedback or need help?** [Discord](https://discord.gg/r72ykfvyx7) [Documentation](https://docs.codeautopilot.com/) [support@codeautopilot.com](mailto:support@codeautopilot.com)