मॉडल
बेस URL और आवश्यक होने पर API कुंजी से OpenAI-संगत या Anthropic endpoint सेट करें। कनेक्शन जाँचें। स्थानीय मॉडल सर्वर चालू होना चाहिए; दूरस्थ उपकरण अलग से डेटा भेज सकते हैं।
PhraseNacre बाइट उदाहरणों के साथ LZ78 शब्दकोश संदर्भों और अंतिम अधूरे वाक्यांश का परीक्षण करने देता है।
बेस URL और आवश्यक होने पर API कुंजी से OpenAI-संगत या Anthropic endpoint सेट करें। कनेक्शन जाँचें। स्थानीय मॉडल सर्वर चालू होना चाहिए; दूरस्थ उपकरण अलग से डेटा भेज सकते हैं।
फ़ोल्डर चुनें और संपादन से पहले सहायक से संबंधित फ़ाइलें पढ़ने को कहें। काम का उद्देश्य और सीमाएँ बताएँ।
बदलाव और कमांड का आउटपुट देखें। परिणाम स्वीकार करने से पहले प्रोजेक्ट की जाँच चलाएँ; बनाया गया कोड अपने आप परीक्षण किया हुआ नहीं होता।
def lz78_tokens(data):
if type(data) is not bytes or len(data) > 4096:
raise ValueError("lz78.input")
dictionary, phrase, output = {b"": 0}, b"", []
for byte in data:
extended = phrase + bytes([byte])
if extended in dictionary:
phrase = extended
else:
output.append((dictionary[phrase], byte))
dictionary[extended] = len(dictionary)
phrase = b""
if phrase:
output.append((dictionary[phrase], None))
return output