Skip to content

Commit

Permalink
refactor: removed redundant packages, cleaned up old tokenizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Jul 18, 2024
1 parent 95f77f1 commit c6c8462
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 515,787 deletions.
169 changes: 0 additions & 169 deletions app/Classifier.tsx

This file was deleted.

40 changes: 19 additions & 21 deletions constants/LlamaLocal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CompletionParams, ContextParams, LlamaContext, initLlama } from 'cui-llama.rn'
import { getDocumentAsync } from 'expo-document-picker'
import * as FS from 'expo-file-system'
import { Platform } from 'react-native'
import DocumentPicker from 'react-native-document-picker'
import { create } from 'zustand'

import { AppSettings, Global } from './GlobalValues'
Expand Down Expand Up @@ -411,27 +411,25 @@ export namespace Llama {
}

export const importModel = async () => {
return DocumentPicker.pickSingle()
.then(async (result: any) => {
if (DocumentPicker.isCancel(result)) return false
const name = result.name
Logger.log('Importing file...', true)
await FS.copyAsync({
from: result.uri,
to: `${model_dir}${name}`,
})
.then(() => {
Logger.log('File Imported!', true)
})
.catch((error) => {
Logger.log(`Import Failed: ${error.message}`, true)
})

return false
})
.catch(() => {
Logger.log('No Model Chosen', true)
return getDocumentAsync({
type: 'application/octet-stream',
copyToCacheDirectory: false,
}).then(async (result) => {
if (result.canceled) return
const file = result.assets[0]
const name = file.name
Logger.log('Importing file...', true)
await FS.copyAsync({
from: file.uri,
to: `${model_dir}${name}`,
})
.then(() => {
Logger.log('File Imported!', true)
})
.catch((error) => {
Logger.log(`Import Failed: ${error.message}`, true)
})
}).catch
}

export const getKVSizeMB = async () => {
Expand Down
Loading

0 comments on commit c6c8462

Please sign in to comment.