Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
all in one gpt
Browse files Browse the repository at this point in the history
  • Loading branch information
xRiddin committed Oct 19, 2023
1 parent 84dd66e commit fee9ea3
Show file tree
Hide file tree
Showing 40 changed files with 1,768 additions and 1,505 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main_ikyet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: pip install -r requirements.txt

# Optional: Add step to run tests here (PyTest, Django test suites, etc.)

- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v2
with:
Expand All @@ -53,7 +53,7 @@ jobs:
with:
name: python-app
path: .

- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
Expand Down
Empty file added __init__.py
Empty file.
21 changes: 13 additions & 8 deletions app_websocket.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import os, time, yaml, tiktoken
import uvicorn
import threading
import os
import shutil
import tempfile
import threading
import tiktoken
import time
import yaml
from typing import List

import uvicorn
from fastapi import FastAPI, File, UploadFile, WebSocket, WebSocketDisconnect, Request
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from models.gpt_nova import generate as g

from ikyet_render.models.gpt.gpt_messages import generate as g
from output_adv import final as m
from output_quick import director
from output_quick import final as n
Expand All @@ -34,6 +37,7 @@
messages = [{'role': 'system', 'content': jenn}]
websocket_connections = {}


@app.get("/")
async def index(request: Request):
return templates.TemplateResponse("index.html", {"request": request, "report": None})
Expand Down Expand Up @@ -80,7 +84,7 @@ async def playgrd(websocket: WebSocket):
@app.websocket("/jen")
async def jen(websocket: WebSocket):
await websocket.accept()
#websocket_connections[client_id] = websocket
# websocket_connections[client_id] = websocket
while True:
try:
data = await websocket.receive_json()
Expand All @@ -99,7 +103,7 @@ async def jen(websocket: WebSocket):
await websocket.send_json({'output': res})
except WebSocketDisconnect:
print("websocket disconnected")
#del websocket_connections[client_id]
# del websocket_connections[client_id]
await websocket.close()
break

Expand Down Expand Up @@ -168,8 +172,8 @@ async def download():
finally:
threading.Thread(target=delayed_delete, args=(directory_path,)).start()
# finally:
# shutil.rmtree(temp_dir)
# shutil.rmtree(directory_path)
# shutil.rmtree(temp_dir)
# shutil.rmtree(directory_path)


def delayed_delete(*paths):
Expand All @@ -189,6 +193,7 @@ def generate_directory_name():
directory = director()
return directory


def tokens(message):
encoding = tiktoken.get_encoding("cl100k_base")
num_tokens = len(encoding.encode(message))
Expand Down
3 changes: 3 additions & 0 deletions client/index_mob.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}

.top-container {
background-color: #f1f1f1;
padding: 30px;
text-align: center;
}

.content {
padding: 16px;
}

@media screen and (max-width: 600px) {
.top-container, .content {
padding: 10px;
Expand Down
10 changes: 6 additions & 4 deletions client/pw.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ <h1 style="text-align-all: center; font-family: 'Arial Rounded MT Bold',serif">I
</button>
</div>
<div class="box" id="messages">
<p style="align-content: center; padding: 5px; margin: 20px">Academics: talk with your friendly teaching assistant "Kat"<br><br>
<p style="align-content: center; padding: 5px; margin: 20px">Academics: talk with your friendly teaching
assistant "Kat"<br><br>
Special commands to use:<br>/imagine: to generate images using AI(standard diffusion model)<br><br>
/ppt: to generate powerpoint presentation file on the topic<br><br>
/yt: to summarize the youtube video, just paste the youtube link<br><br>
/input: to read the file and perform the task using AI, press the input and submit button. then enter the query.<br><br>
/ppt: to generate powerpoint presentation file on the topic<br><br>
/yt: to summarize the youtube video, just paste the youtube link<br><br>
/input: to read the file and perform the task using AI, press the input and submit button. then enter
the query.<br><br>
</p>
<div id="imageContainer"></div>
</div>
Expand Down
31 changes: 16 additions & 15 deletions client/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,25 @@
@import "./options.css";
@import "./theme-toggler.css";
@import "./checkbox1.css";

@media screen and (max-width: 768px) {
.navbar {
flex-direction: column;
}
.navbar {
flex-direction: column;
}

.nav-links {
flex-direction: column;
}
.nav-links {
flex-direction: column;
}

.main-container {
flex-direction: column-reverse;
}
.main-container {
flex-direction: column-reverse;
}

.sidebar, .conversation {
width: 100%;
}
.sidebar, .conversation {
width: 100%;
}

.mobile-sidebar {
display: block;
}
.mobile-sidebar {
display: block;
}
}
2 changes: 1 addition & 1 deletion models/claude2_file.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .claude_api import Client


SESSION_KEY = "__cf_bm=RNkxkN5Pnf8x2.bhA8tjTbHK.D8hVJbjT5JG2ma9LwA-1694918420-0-AV7bo+LTz6IVIVUy3+7FGFoYsYXPd8fRHzvIw7X548cCftVlhdjRSa7cC7Ojte4qsK1TANBcF76YfceExCbweLA=; cf_clearance=2m7AzMArl5_N2ckA3cmUGb_vwgNTF5NeRcolmJfxd6E-1694918423-0-1-9ce7f260.a4aafa5c.cbe6ad80-0.2.1694918423; intercom-device-id-lupk8zyo=d88ca19d-429d-4280-bfc0-736aaf3cf335; sessionKey=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; intercom-session-lupk8zyo=aDRhQUR2SlpDN1NKb2JzQ2ZDdFNlK2VmS3l6UXdQQXFJZFB0cGFoODlQN0tyZDVCaHpJVW1DS0g4RExqemQyZi0tMGRyYkhHeG9DSGl3VGdMNHFQTGx4Zz09--6143d3d68836a0d48d989f306644cdec76e9e3db"


def file(files):
print("this is claude2")
claude = Client(SESSION_KEY)
Expand Down
Loading

0 comments on commit fee9ea3

Please sign in to comment.