We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Language model
npm install @wfloat/wfloat-web
import { loadLanguageModel } from '@wfloat/wfloat-web';
const model = await loadLanguageModel('HuggingFaceTB/SmolLM2-360M-Instruct');
const result = await model.generate([
{ role: 'user', content: 'What is a solar eclipse?' },
]).result();
console.log(result.text);
await model.unload();
npm install @wfloat/react-native-wfloat
cd ios && pod install
Rebuild the app after installation. Native setup.
import { loadLanguageModel } from '@wfloat/react-native-wfloat';
const model = await loadLanguageModel('HuggingFaceTB/SmolLM2-360M-Instruct');
const result = await model.generate([
{ role: 'user', content: 'What is a solar eclipse?' },
]).result();
console.log(result.text);
await model.unload();
pip install wfloat
from wfloat import load_language_model
with load_language_model("HuggingFaceTB/SmolLM2-360M-Instruct") as model:
result = model.generate([{"role": "user", "content": "What is a solar eclipse?"}])
print(result.text)