Spaces:
Running
Running
SimaFarazi
commited on
Commit
β’
095fe6b
1
Parent(s):
5a1a8c1
restructur
Browse files- Dockerfile +2 -2
- {api β app}/callbacks.py +0 -0
- {api β app}/chains.py +0 -0
- {api β app}/crud.py +0 -0
- {api β app}/data_indexing.py +0 -0
- {api β app}/database.py +0 -0
- {api β app}/main.py +0 -0
- {api β app}/models.py +0 -0
- {api β app}/prompts.py +0 -0
- {api β app}/schemas.py +0 -0
- app_hello_world.py +0 -6
- app_hello_world/{main.py β app/main.py} +0 -0
- app.py β app_simple_stream/app.py +0 -0
- callbacks.py β app_simple_stream/callbacks.py +0 -0
- chains.py β app_simple_stream/chains.py +0 -0
- crud.py β app_simple_stream/crud.py +0 -0
- data_indexing.py β app_simple_stream/data_indexing.py +0 -0
- database.py β app_simple_stream/database.py +0 -0
- models.py β app_simple_stream/models.py +0 -0
- prompts.py β app_simple_stream/prompts.py +0 -0
- requirements.txt β app_simple_stream/requirements.txt +0 -0
- schemas.py β app_simple_stream/schemas.py +0 -0
- requirements_hello_world.txt +0 -2
- test.py +6 -0
Dockerfile
CHANGED
@@ -14,6 +14,6 @@ COPY --chown=user ./app_hello_world/requirements.txt requirements.txt
|
|
14 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
15 |
# Copy the rest of the application code from the host to the container
|
16 |
# Again, ensure the copied files are owned by 'user'
|
17 |
-
COPY --chown=user ./app_hello_world/* /app
|
18 |
# Specify the command to run when the container starts
|
19 |
-
CMD ["uvicorn", "
|
|
|
14 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
15 |
# Copy the rest of the application code from the host to the container
|
16 |
# Again, ensure the copied files are owned by 'user'
|
17 |
+
COPY --chown=user ./app_hello_world/app/* /app
|
18 |
# Specify the command to run when the container starts
|
19 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
{api β app}/callbacks.py
RENAMED
File without changes
|
{api β app}/chains.py
RENAMED
File without changes
|
{api β app}/crud.py
RENAMED
File without changes
|
{api β app}/data_indexing.py
RENAMED
File without changes
|
{api β app}/database.py
RENAMED
File without changes
|
{api β app}/main.py
RENAMED
File without changes
|
{api β app}/models.py
RENAMED
File without changes
|
{api β app}/prompts.py
RENAMED
File without changes
|
{api β app}/schemas.py
RENAMED
File without changes
|
app_hello_world.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
from fastapi import FastAPI
|
2 |
-
app = FastAPI()
|
3 |
-
# Expose an endpoint at the root of URL
|
4 |
-
@app.get("/")
|
5 |
-
def greet_json():
|
6 |
-
return{"Hello":"World!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app_hello_world/{main.py β app/main.py}
RENAMED
File without changes
|
app.py β app_simple_stream/app.py
RENAMED
File without changes
|
callbacks.py β app_simple_stream/callbacks.py
RENAMED
File without changes
|
chains.py β app_simple_stream/chains.py
RENAMED
File without changes
|
crud.py β app_simple_stream/crud.py
RENAMED
File without changes
|
data_indexing.py β app_simple_stream/data_indexing.py
RENAMED
File without changes
|
database.py β app_simple_stream/database.py
RENAMED
File without changes
|
models.py β app_simple_stream/models.py
RENAMED
File without changes
|
prompts.py β app_simple_stream/prompts.py
RENAMED
File without changes
|
requirements.txt β app_simple_stream/requirements.txt
RENAMED
File without changes
|
schemas.py β app_simple_stream/schemas.py
RENAMED
File without changes
|
requirements_hello_world.txt
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
fastapi
|
2 |
-
uvicorn[standard]
|
|
|
|
|
|
test.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langserve import RemoteRunnable
|
2 |
+
url = "https://simafarazi-backend-c.hf.space/simple/"
|
3 |
+
chain = RemoteRunnable(url)
|
4 |
+
stream = chain.stream(input={'question':'How are you?'})
|
5 |
+
for chunk in stream:
|
6 |
+
print(chunk, end="", flush=True)
|