This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./App.css"; | |
import { useEffect, useState } from "react"; | |
import { useCompletion } from "ai/react"; | |
function App() { | |
const [apiResponse, setApiResponse] = useState(""); | |
useEffect(() => { | |
fetch("/api/reply?value=Hello from React App!") | |
.then((response) => response.json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# train_grpo.py | |
import re | |
import torch | |
from datasets import load_dataset, Dataset | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from peft import LoraConfig | |
from trl import GRPOConfig, GRPOTrainer | |
# Load and prep dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Swift Language Fundamentals | |
Swift is a modern programming language for Apple platforms (iOS, macOS, etc.) with these key characteristics: | |
1. Core Features: | |
- Type inference for automatic type detection | |
- Optionals for safe handling of missing values | |
- Closures for flexible function passing | |
- Memory safety by design | |
- Built-in error handling |