Benjamin Bossan commited on
Commit
e6fd86e
1 Parent(s): 126a4c6

Move stuff around, make installable

Browse files
README.md CHANGED
@@ -1,15 +1,32 @@
1
  # Dump your knowledge, let AI refine it
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## Starting
4
 
5
- Install stuff, then, in one terminal, start the background worker:
6
 
7
  ```sh
8
  cd src
9
  python worker.py
10
  ```
11
 
12
- Start the web server:
13
 
14
  ```sh
15
  cd src
 
1
  # Dump your knowledge, let AI refine it
2
 
3
+ ## Installation
4
+
5
+ Create a Python environment with Python 3.10+. Install the requirements and the package:
6
+
7
+ ``` sh
8
+ python -m pip install -r requirements.txt
9
+ python -m pip install .
10
+ ```
11
+
12
+ For development, instead do:
13
+
14
+ ``` sh
15
+ python -m pip install -r requirements.txt
16
+ python -m pip install -r requirements-dev.txt
17
+ python -m pip install -e .
18
+ ```
19
+
20
  ## Starting
21
 
22
+ In one terminal, start the background worker:
23
 
24
  ```sh
25
  cd src
26
  python worker.py
27
  ```
28
 
29
+ In another terminal, start the web server:
30
 
31
  ```sh
32
  cd src
VERSION ADDED
@@ -0,0 +1 @@
 
 
1
+ 0.0.1
requests.org CHANGED
@@ -22,7 +22,7 @@ curl -X 'POST' \
22
  #+end_src
23
 
24
  #+RESULTS:
25
- : Submitted job 04d44970ced1473999dfab77b02202b8
26
 
27
  #+begin_src bash
28
  curl -X 'POST' \
@@ -36,16 +36,16 @@ curl -X 'POST' \
36
  #+end_src
37
 
38
  #+RESULTS:
39
- : Submitted job 3cc2104aec0748b1bd5743c321b169ac
40
 
41
  #+begin_src bash
42
  curl -X 'GET' \
43
- 'http://localhost:8080/check_status/22b158499b744f42918912cd387fd657' \
44
  -H 'accept: application/json'
45
  #+end_src
46
 
47
  #+RESULTS:
48
- | {"id":"22b158499b744f42918912cd387fd657" | status:"done" | last_updated:"2023-05-05T14:54:11"} |
49
 
50
  #+begin_src bash
51
  curl -X 'GET' \
@@ -54,4 +54,4 @@ curl -X 'GET' \
54
  #+end_src
55
 
56
  #+RESULTS:
57
- | [{"id":"3cc2104aec0748b1bd5743c321b169ac" | author:"ben" | summary:"A new approach to NLP that incorporates reinforcement learning and human feedback. How does it work? Why does it work? In this post | I’ll explain how it works. RLHF is a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback." | tags:["#general" | #rlhf] | date:"2023-05-05T14:56:32"} | {"id":"04d44970ced1473999dfab77b02202b8" | author:"ben" | summary:"GitLab | the most comprehensive | scalable enterprise DevSecOps platform for software innovation | and Google Cloud today announced an extension of their strategic partnership to deliver secure AI offerings to the enterprise. By leveraging Google Cloud's customizable foundation models and open generative AI infrastructure | GitLab will provide customers with AI-assisted features directly within the enterprise DevSecOps platform. The company's AI capabilities are designed to help enterprises improve productivity and reduce costs." | tags:["#general"] | date:"2023-05-05T14:56:31"}] |
 
22
  #+end_src
23
 
24
  #+RESULTS:
25
+ : Submitted job 6012b198ffe0467d9344a196a2ced121
26
 
27
  #+begin_src bash
28
  curl -X 'POST' \
 
36
  #+end_src
37
 
38
  #+RESULTS:
39
+ : Submitted job 05058b906f524fb4bfedc4f5a84eff06
40
 
41
  #+begin_src bash
42
  curl -X 'GET' \
43
+ 'http://localhost:8080/check_status/6012b198ffe0467d9344a196a2ced121' \
44
  -H 'accept: application/json'
45
  #+end_src
46
 
47
  #+RESULTS:
48
+ | {"id":"6012b198ffe0467d9344a196a2ced121" | status:"done" | last_updated:"2023-05-08T12:27:07"} |
49
 
50
  #+begin_src bash
51
  curl -X 'GET' \
 
54
  #+end_src
55
 
56
  #+RESULTS:
57
+ | [{"id":"05058b906f524fb4bfedc4f5a84eff06" | author:"ben" | summary:"A new approach to NLP that incorporates reinforcement learning and human feedback. How does it work? Why does it work? In this post | I’ll explain how it works. RLHF is a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback. It’s a new approach to NLP that incorporates reinforcement learning and human feedback." | tags:["#general" | #rlhf] | date:"2023-05-08T12:27:31"} | {"id":"6012b198ffe0467d9344a196a2ced121" | author:"ben" | summary:"GitLab | the most comprehensive | scalable enterprise DevSecOps platform for software innovation | and Google Cloud today announced an extension of their strategic partnership to deliver secure AI offerings to the enterprise. By leveraging Google Cloud's customizable foundation models and open generative AI infrastructure | GitLab will provide customers with AI-assisted features directly within the enterprise DevSecOps platform. The company's AI capabilities are designed to help enterprises improve productivity and reduce costs." | tags:["#general"] | date:"2023-05-08T12:27:07"}] |
requirements-dev.txt CHANGED
@@ -2,3 +2,5 @@ black
2
  isort
3
  mypy
4
  ruff
 
 
 
2
  isort
3
  mypy
4
  ruff
5
+ pytest
6
+ pytest-cov
setup.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ from setuptools import setup, find_packages
4
+
5
+
6
+ with open('VERSION', 'r') as f:
7
+ version = f.read().rstrip()
8
+
9
+ with open('requirements.txt') as f:
10
+ install_requires = [l.strip() for l in f]
11
+
12
+
13
+ python_requires = '>=3.10'
14
+
15
+ tests_require = [
16
+ 'black',
17
+ 'mypy',
18
+ 'pytest',
19
+ 'pytest-cov',
20
+ 'ruff',
21
+ ]
22
+
23
+ here = os.path.abspath(os.path.dirname(__file__))
24
+ try:
25
+ README = open(os.path.join(here, 'README.md')).read()
26
+ except IOError:
27
+ README = ''
28
+
29
+
30
+ setup(
31
+ name='gistillery',
32
+ version=version,
33
+ description="TODO",
34
+ long_description=README,
35
+ license='new BSD 3-Clause',
36
+ packages=find_packages('src'),
37
+ package_dir={'': 'src'},
38
+ include_package_data=True,
39
+ python_requires=python_requires,
40
+ install_requires=install_requires,
41
+ extras_require={
42
+ 'tests': tests_require,
43
+ },
44
+ )
src/{base.py → gistillery/base.py} RENAMED
File without changes
src/{db.py → gistillery/db.py} RENAMED
File without changes
src/{ml.py → gistillery/ml.py} RENAMED
@@ -5,7 +5,7 @@ import re
5
 
6
  import httpx
7
 
8
- from base import JobInput
9
 
10
  logger = logging.getLogger(__name__)
11
  logger.setLevel(logging.DEBUG)
 
5
 
6
  import httpx
7
 
8
+ from gistillery.base import JobInput
9
 
10
  logger = logging.getLogger(__name__)
11
  logger.setLevel(logging.DEBUG)
src/{webservice.py → gistillery/webservice.py} RENAMED
@@ -3,8 +3,8 @@ import uuid
3
 
4
  from fastapi import FastAPI
5
 
6
- from base import EntriesResult, JobStatus, JobStatusResult, RequestInput
7
- from db import TABLES, get_db_cursor
8
 
9
 
10
  logger = logging.getLogger(__name__)
 
3
 
4
  from fastapi import FastAPI
5
 
6
+ from gistillery.base import EntriesResult, JobStatus, JobStatusResult, RequestInput
7
+ from gistillery.db import TABLES, get_db_cursor
8
 
9
 
10
  logger = logging.getLogger(__name__)
src/{worker.py → gistillery/worker.py} RENAMED
@@ -1,9 +1,9 @@
1
  import time
2
  from dataclasses import dataclass
3
 
4
- from base import JobInput
5
- from db import get_db_cursor
6
- from ml import (
7
  DefaultUrlProcessor,
8
  HfTransformersSummarizer,
9
  HfTransformersTagger,
 
1
  import time
2
  from dataclasses import dataclass
3
 
4
+ from gistillery.base import JobInput
5
+ from gistillery.db import get_db_cursor
6
+ from gistillery.ml import (
7
  DefaultUrlProcessor,
8
  HfTransformersSummarizer,
9
  HfTransformersTagger,