Charreau Bell, Ph.D commited on
Commit
752088d
1 Parent(s): f7234de

Merge pull request #213 from vanderbilt-data-science/retrieval_fix

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. README.md +33 -0
  3. requirements.txt +7 -7
Dockerfile CHANGED
@@ -12,7 +12,7 @@ RUN pip install --no-cache-dir --upgrade pip
12
  RUN --mount=type=secret,id=PIPLOC,mode=0444,required=true \
13
  bash -c "PIPLOC=$(cat /run/secrets/PIPLOC); pip install --no-deps --no-cache-dir \${PIPLOC}"
14
 
15
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
 
17
  # Set up a new user named "user" with user ID 1000
18
  RUN useradd -m -u 1000 user
 
12
  RUN --mount=type=secret,id=PIPLOC,mode=0444,required=true \
13
  bash -c "PIPLOC=$(cat /run/secrets/PIPLOC); pip install --no-deps --no-cache-dir \${PIPLOC}"
14
 
15
+ RUN pip install --no-cache-dir -r /code/requirements.txt
16
 
17
  # Set up a new user named "user" with user ID 1000
18
  RUN useradd -m -u 1000 user
README.md CHANGED
@@ -46,6 +46,39 @@ Commonly used secret variables may include "OPENAI_API_KEY", "SECRET_PROMPT", an
46
 
47
 
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  # **Duplication and Deployment Instructions for Huggingface Spaces**
50
 
51
  This README contains duplication and deployment instructions for CLAS applications deployed with Huggingface Spaces. These apps allow students to interact with a chatbot tutor which provides quiz questions, feedback, and academic guidance on the subject.
 
46
 
47
 
48
 
49
+ # **Duplication and Deployment Instructions for Huggingface Spaces**
50
+
51
+ This README contains duplication and deployment instructions for CLAS applications deployed with Huggingface Spaces. These apps allow students to interact with a chatbot tutor which provides quiz questions, feedback, and academic guidance on the subject.
52
+
53
+ After the conversation is over, a JSON file with chat history will be available for download.
54
+
55
+ ## **How to duplicate the Huggingface Space**
56
+
57
+ An instructor must duplicate a Space if they wish to build from an existing demo to make changes or incorporate specific environment variables.
58
+
59
+ If you want to duplicate a Space, click the three dots at the top right of the space and click Duplicate this Space. Once you do this, you will be able to change the following attributes:
60
+
61
+ **Owner**: The duplicated Space can be under your account or any organization in which you have write access
62
+ **Space name**
63
+ **Visiblity**: The Space is private by default. Read more about private repositories here.
64
+ **Hardware**: You can choose the hardware on which the Space will be running. Read more about hardware upgrades here.
65
+ **Storage**: If the original repo uses persistent storage, you will be prompted to choose a storage tier. Read more about persistent storage here.
66
+ **Secrets and variables**: If the original repo has set some secrets and variables, you’ll be able to set them while duplicating the repo.
67
+
68
+ If the Space requires utilizes environment variables, the duplicate workflow will auto-populate the public Variables from the source Space, and give you a warning about setting up the Secrets. The duplicated Space will use a free CPU hardware by default, but you can later upgrade if needed.
69
+
70
+ ## **How to manage Huggingface Secrets**
71
+
72
+ Repository Secrets store values including access tokens, API keys, or any sensitive value or credentials. Secrets are private and their value cannot be retrieved once set. They will not be added to Spaces duplicated from your repository.
73
+
74
+ Commonly used secret variables may include "OPENAI_API_KEY", "SECRET_PROMPT", and "PIPLOC." Instructions for inputting values into these variables are below.
75
+
76
+ 1. The input for the "OPENAI_API_KEY" secret can be the instructor's personal OpenAI API key. If you do not already have an API key, navigate to the API section of the OpenAI website. Click to generate a new API key and save this value in a secure location.
77
+ 2. The input for "SECRET_PROMPT" includes the persona and prompt given to the chatbot tutor to guide its interaction with students.
78
+ 3. The input for "PIPLOC" allows the app to access other files in the CLAS project. The input is a value in the following form: git+https://ghusername:ghpersonalaccesstoken@github.com/vanderbilt-data-science/lo-achievement.git with "ghusername" replaced by your personal Github username and "ghpersonalaccesstoken" replaced by your Github personal access token.
79
+
80
+
81
+
82
  # **Duplication and Deployment Instructions for Huggingface Spaces**
83
 
84
  This README contains duplication and deployment instructions for CLAS applications deployed with Huggingface Spaces. These apps allow students to interact with a chatbot tutor which provides quiz questions, feedback, and academic guidance on the subject.
requirements.txt CHANGED
@@ -1,10 +1,10 @@
1
- langchain
2
  pandas
3
  numpy
4
- openai
5
- gradio>3.5,<4.0
6
- chromadb
7
- tiktoken
8
- unstructured
9
  poppler-utils
10
- unstructured[pdf]
 
1
+ langchain==0.0.327
2
  pandas
3
  numpy
4
+ openai==0.28.1
5
+ gradio==3.45.2
6
+ chromadb==0.4.13
7
+ tiktoken==0.5.1
8
+ unstructured==0.10.18
9
  poppler-utils
10
+ unstructured[pdf]