Mbonea commited on
Commit
9b5be52
·
1 Parent(s): 8ba499f

Revert "bulleted"

Browse files

This reverts commit f7b04a6bfe10e2826b8c1579c11bb7525d346cd1.

Files changed (3) hide show
  1. App/Chat/utils/Summarize.py +5 -3
  2. App/__init__.py +27 -1
  3. App/app.py +2 -2
App/Chat/utils/Summarize.py CHANGED
@@ -25,7 +25,7 @@ text_splitter = RecursiveCharacterTextSplitter(
25
 
26
 
27
  map_prompt = """
28
- Write a concise summary of the following:
29
  "{text}"
30
  CONCISE SUMMARY:
31
  """
@@ -33,9 +33,11 @@ CONCISE SUMMARY:
33
 
34
  combine_prompt = """
35
  Write a concise summary of the following text delimited by triple backquotes.
36
- Return your response in bullet points which covers the key points of the text.
 
37
  ```{text}```
38
- BULLET POINT SUMMARY:
 
39
  """
40
 
41
 
 
25
 
26
 
27
  map_prompt = """
28
+ Write a verbose summary like a masters student of the following:
29
  "{text}"
30
  CONCISE SUMMARY:
31
  """
 
33
 
34
  combine_prompt = """
35
  Write a concise summary of the following text delimited by triple backquotes.
36
+ Return your response in a detailed verbose paragraph which covers the text. Make it as insightful to the reader as possible, write like a masters student.
37
+
38
  ```{text}```
39
+
40
+ SUMMARY:
41
  """
42
 
43
 
App/__init__.py CHANGED
@@ -1,17 +1,43 @@
1
  import uuid, contextvars
2
  from telethon import TelegramClient
 
 
3
 
4
 
5
  import os
6
 
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  bot = TelegramClient(
9
- "./App/6183919505.session",
10
  api_id=870972,
11
  api_hash="ce2efaca02dfcd110941be6025e9ac0d",
12
  )
13
 
14
 
 
15
  # upload_bot = Client(
16
  # str("the book"),
17
  # api_id=870972,
 
1
  import uuid, contextvars
2
  from telethon import TelegramClient
3
+ from telethon.sync import TelegramClient
4
+ from telethon.sessions import StringSession
5
 
6
 
7
  import os
8
 
9
 
10
+ def genUUID():
11
+ uuid_value = uuid.uuid4()
12
+ short_uuid = str(uuid_value)[:6]
13
+ return short_uuid
14
+
15
+
16
+ SESSION_STRING = ""
17
+ with TelegramClient(
18
+ f"./App/{genUUID()}.session",
19
+ api_id=870972,
20
+ api_hash="ce2efaca02dfcd110941be6025e9ac0d",
21
+ ) as client:
22
+ client.start(bot_token="6183919505:AAEhHFt4mI18bQeAf2Lj7AePXFRPVLrOFM8")
23
+ ... # use the client
24
+
25
+ # Save the string session as a string; you should decide how
26
+ # you want to save this information (over a socket, remote
27
+ # database, print it and then paste the string in the code,
28
+ # etc.); the advantage is that you don't need to save it
29
+ # on the current disk as a separate file, and can be reused
30
+ # anywhere else once you log in.
31
+ SESSION_STRING = client.session.save()
32
+
33
  bot = TelegramClient(
34
+ StringSession(SESSION_STRING),
35
  api_id=870972,
36
  api_hash="ce2efaca02dfcd110941be6025e9ac0d",
37
  )
38
 
39
 
40
+
41
  # upload_bot = Client(
42
  # str("the book"),
43
  # api_id=870972,
App/app.py CHANGED
@@ -10,7 +10,7 @@ from .Transcription.TranscriptionRoutes import transcription_router
10
  from .Streaming.StreamingRoutes import streaming_router
11
  from .UserTranscriptions.UserTranscriptionsRoutes import user_transcriptions_router
12
  from .Monitor.monitorRoutes import monitor_router
13
- from .Embedding.EmbeddingRoutes import embeddigs_router
14
  from .Chat.ChatRoutes import chat_router
15
 
16
  from fastapi.middleware.cors import CORSMiddleware
@@ -78,5 +78,5 @@ app.include_router(transcription_router)
78
  app.include_router(streaming_router)
79
  app.include_router(monitor_router)
80
  app.include_router(user_transcriptions_router)
81
- app.include_router(embeddigs_router)
82
  app.include_router(chat_router)
 
10
  from .Streaming.StreamingRoutes import streaming_router
11
  from .UserTranscriptions.UserTranscriptionsRoutes import user_transcriptions_router
12
  from .Monitor.monitorRoutes import monitor_router
13
+ # from .Embedding.EmbeddingRoutes import embeddigs_router
14
  from .Chat.ChatRoutes import chat_router
15
 
16
  from fastapi.middleware.cors import CORSMiddleware
 
78
  app.include_router(streaming_router)
79
  app.include_router(monitor_router)
80
  app.include_router(user_transcriptions_router)
81
+ # app.include_router(embeddigs_router)
82
  app.include_router(chat_router)