Skip to main content
Glama
index.test.ts819 B
import * as tf from '@tensorflow/tfjs-node'; import { HopeMemoryModel } from '../model.js'; describe('HopeMemoryModel Tests', () => { let model: HopeMemoryModel; beforeEach(async () => { model = new HopeMemoryModel(); await model.initialize(); }); afterEach(() => { model.dispose(); }); it('supports encoding text into tensors', async () => { const tensor = await model.encodeText('Testing HOPE memory'); expect(tensor.shape[1]).toBeGreaterThan(0); }); it('applies trainStep without throwing', () => { const input = tf.tensor2d([[0.1, 0.2, 0.3, 0.4]]); const target = tf.tensor2d([[0.4, 0.3, 0.2, 0.1]]); const state = model.createInitialState(); const result = model.trainStep(input, target, state); expect(result.loss.arraySync()).toBeDefined(); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/henryhawke/mcp-titan'

If you have feedback or need assistance with the MCP directory API, please join our Discord server