Skip to content

Commit

Permalink
chore: updated to Expo SDK52, testing new architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Nov 15, 2024
1 parent 70e2170 commit ef4755d
Show file tree
Hide file tree
Showing 18 changed files with 3,704 additions and 3,439 deletions.
2 changes: 2 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
expo: {
name: 'ChatterUI',
newArchEnabled: true,
slug: 'ChatterUI',
version: '0.8.2',
orientation: 'portrait',
Expand Down Expand Up @@ -77,6 +78,7 @@ module.exports = {
],
experiments: {
typedRoutes: true,
reactCompiler: true,
},
extra: {
router: {
Expand Down
4 changes: 2 additions & 2 deletions app/AppSettingsMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Alert } from '@components/Alert'
import SectionTitle from '@components/SectionTitle'
import SwitchWithDescription from '@components/SwitchWithDescription'
import { copyFile, DocumentDirectoryPath, DownloadDirectoryPath } from '@dr.pogodin/react-native-fs'
import { Style, AppSettings, Logger, Characters } from '@globals'
import appConfig from 'app.config'
import { copyFile, DocumentDirectoryPath, DownloadDirectoryPath } from 'cui-fs'
import { reloadAppAsync } from 'expo'
import { getDocumentAsync } from 'expo-document-picker'
import { documentDirectory, copyAsync, deleteAsync } from 'expo-file-system'
import { Stack, useRouter } from 'expo-router'
import React from 'react'
import { StyleSheet, Text, View, Switch, TouchableOpacity, ScrollView } from 'react-native'
import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native'
import { useMMKVBoolean } from 'react-native-mmkv'

const appVersion = appConfig.expo.version
Expand Down
2 changes: 1 addition & 1 deletion app/CharacterEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const ChracterEditor = () => {
if (characterCard && charId)
return Characters.db.mutate.updateCard(characterCard, charId).then(() => {
setCurrentCard(charId)
setEdited(false)
setEdited(() => false)
Logger.log('Card Saved!', true)
})
}
Expand Down
2 changes: 1 addition & 1 deletion app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MenuProvider } from 'react-native-popup-menu'
import migrations from '../db/migrations/migrations'

const DevDB = () => {
useDrizzleStudio(rawdb)
// useDrizzleStudio(rawdb)
return <></>
}

Expand Down
5 changes: 3 additions & 2 deletions app/components/ChatMenu/ChatWindow/EditorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
View,
TextInput,
} from 'react-native'
import Animated, { SlideInDown, SlideInUp, SlideOutDown } from 'react-native-reanimated'
import { useShallow } from 'zustand/react/shallow'

type EditorButtonProps = {
Expand Down Expand Up @@ -96,7 +97,7 @@ const EditorModal: React.FC<EditorProps> = ({ id, isLastMessage, setEditMode, ed
onRequestClose={handleClose}
style={{ flex: 1 }}>
<FadeScreen handleOverlayClick={handleOverlayClick}>
<View style={styles.editorContainer}>
<Animated.View exiting={SlideOutDown} style={styles.editorContainer}>
<View style={styles.topText}>
<Text style={styles.nameText}>{message?.name}</Text>
<Text style={styles.timeText}>
Expand Down Expand Up @@ -132,7 +133,7 @@ const EditorModal: React.FC<EditorProps> = ({ id, isLastMessage, setEditMode, ed
color="primary-text1"
/>
</View>
</View>
</Animated.View>
</FadeScreen>
</Modal>
</View>
Expand Down
4 changes: 1 addition & 3 deletions app/components/Endpoint/Cohere.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const Cohere = () => {

const getModelList = async () => {
try {
const url = new URL(
'https://api.cohere.com/v1/models?page_size=1000&endpoint=chat'
).toString()
const url = new URL('https://api.cohere.com/v1/models').toString()

const response = await fetch(url, {
headers: {
Expand Down
1 change: 1 addition & 0 deletions app/components/PopupMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const styles = StyleSheet.create({
},

popupButton: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
columnGap: 12,
Expand Down
1 change: 0 additions & 1 deletion app/constants/APIState/OllamaAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class OllamaAPI extends APIBase {
buildPayload = () => {
const payloadFields = this.getSamplerFields()
const length = payloadFields?.['num_ctx']
//const stream = payloadFields?.['stream']
const modelname = this.getObject(Global.OllamaModel).name
return {
model: modelname,
Expand Down
2 changes: 1 addition & 1 deletion app/constants/Characters.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { db as database } from '@db'
import { copyFileRes, writeFile } from '@dr.pogodin/react-native-fs'
import { copyFileRes, writeFile } from 'cui-fs'
import {
characterGreetings,
characterTags,
Expand Down
2 changes: 1 addition & 1 deletion app/constants/Global.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DownloadDirectoryPath, writeFile } from '@dr.pogodin/react-native-fs'
import { DownloadDirectoryPath, writeFile } from 'cui-fs'
import { getCpuFeatures } from 'cui-llama.rn'
import * as Crypto from 'expo-crypto'
import * as FS from 'expo-file-system'
Expand Down
4 changes: 2 additions & 2 deletions app/constants/Markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export namespace MarkdownStyle {
const speechStyle = { color: '#e69d17' }
export const Rules = {
order: SimpleMarkdown.defaultRules.em.order + 0.6,
match(source: string, state: any, lookbehind: any) {
match(source: string) {
return /^"([\s\S]+?)"(?!")/.exec(source)
},
parse(capture: any, parse: any, state: any) {
Expand Down Expand Up @@ -56,7 +56,7 @@ export namespace MarkdownStyle {
color: Style.getColor('primary-text3'),
},
listItemNumber: {
color: Style.getColor('primary-text3'),
color: Style.getColor('primary-brand'),
},

inlineCode: {
Expand Down
108 changes: 0 additions & 108 deletions app/constants/Presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,114 +5,6 @@ import { Global } from './GlobalValues'
import { Logger } from './Logger'
import { mmkv } from './MMKV'
import { SamplerID, SamplerPreset, Samplers } from './SamplerData'
/*
export type SamplerPreset = {
temp: number
top_p: number
top_k: number
top_a: number
// merged from KAI
min_p: number
single_line: boolean
sampler_order: number[]
seed: number
//
tfs: number
epsilon_cutoff: number
eta_cutoff: number
typical: number
rep_pen: number
rep_pen_range: number
rep_pen_slope: number
no_repeat_ngram_size: number
penalty_alpha: number
num_beams: number
length_penalty: number
min_length: number
encoder_rep_pen: number
freq_pen: number
presence_pen: number
do_sample: boolean
early_stopping: boolean
add_bos_token: boolean
truncation_length: number
ban_eos_token: boolean
skip_special_tokens: boolean
streaming: boolean
mirostat_mode: number
mirostat_tau: number
mirostat_eta: number
guidance_scale: number
negative_prompt: string
grammar_string: string
banned_tokens: string
rep_pen_size: number
genamt: number
max_length: number
dynatemp_range: number
smoothing_factor: number
dry_multiplier: number
dry_base: number
dry_allowed_length: number
dry_sequence_break: string
}*/

/*temp: 1,
top_p: 1,
top_k: 40,
top_a: 0,
// merged from KAI
min_p: 0.0,
single_line: false,
//sampler_order: [6, 0, 1, 3, 4, 2, 5],
seed: -1,
//
tfs: 1,
epsilon_cutoff: 0,
eta_cutoff: 0,
typical: 1,
rep_pen: 1,
rep_pen_range: 0,
rep_pen_slope: 1,
no_repeat_ngram_size: 20,
penalty_alpha: 0,
num_beams: 1,
length_penalty: 1,
min_length: 0,
encoder_rep_pen: 1,
freq_pen: 0,
presence_pen: 0,
do_sample: true,
early_stopping: false,
add_bos_token: true,
//truncation_length: 2048,
ban_eos_token: false,
skip_special_tokens: true,
streaming: true,
mirostat_mode: 0,
mirostat_tau: 5,
mirostat_eta: 0.1,
guidance_scale: 1,
negative_prompt: '',
grammar_string: '',
banned_tokens: '',
///rep_pen_size: 0,
genamt: 256,
max_length: 4096,
dynatemp_range: 0,
smoothing_factor: 0,
dry_multiplier: 0,
dry_base: 0,
dry_allowed_length: 0,
dry_sequence_break: '',*/

export type SamplerField = keyof SamplerPreset

Expand Down
Loading

0 comments on commit ef4755d

Please sign in to comment.