Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- README.md +2 -18
- app.py +2 -2
- utils/interpret_lab_results.py +2 -2
README.md
CHANGED
|
@@ -1,19 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
title: BudtenderGuide
|
| 3 |
-
emoji: 🚀
|
| 4 |
-
colorFrom: red
|
| 5 |
-
colorTo: red
|
| 6 |
-
sdk: docker
|
| 7 |
-
app_port: 8501
|
| 8 |
-
tags:
|
| 9 |
-
- streamlit
|
| 10 |
-
pinned: false
|
| 11 |
-
short_description: Streamlit template space
|
| 12 |
-
---
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
|
| 17 |
-
|
| 18 |
-
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
|
| 19 |
-
forums](https://discuss.streamlit.io).
|
|
|
|
| 1 |
+
# Budtender AI Assistant
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
Una app que interpreta resultados de análisis de flores de cannabis y ofrece recomendaciones basadas en terpenos y cannabinoides usando un modelo LLM ligero.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from utils.interpret_lab_results import analyze_lab_results
|
| 3 |
|
| 4 |
-
st.set_page_config(page_title="
|
| 5 |
|
| 6 |
-
st.title("
|
| 7 |
|
| 8 |
st.markdown("Ingresa los resultados del laboratorio con niveles de terpenos y cannabinoides.")
|
| 9 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from utils.interpret_lab_results import analyze_lab_results
|
| 3 |
|
| 4 |
+
st.set_page_config(page_title="Budtender AI Assistant", layout="wide")
|
| 5 |
|
| 6 |
+
st.title("Budtender AI Assistant")
|
| 7 |
|
| 8 |
st.markdown("Ingresa los resultados del laboratorio con niveles de terpenos y cannabinoides.")
|
| 9 |
|
utils/interpret_lab_results.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
-
generator = pipeline("text-generation", model="
|
| 4 |
|
| 5 |
def analyze_lab_results(input_text):
|
| 6 |
prompt = (
|
|
@@ -10,5 +10,5 @@ def analyze_lab_results(input_text):
|
|
| 10 |
f"{input_text}\n\n"
|
| 11 |
"Análisis:"
|
| 12 |
)
|
| 13 |
-
result = generator(prompt, max_length=
|
| 14 |
return result[0]['generated_text'].split("Análisis:")[-1].strip()
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
+
generator = pipeline("text-generation", model="tiiuae/falcon-rw-1b")
|
| 4 |
|
| 5 |
def analyze_lab_results(input_text):
|
| 6 |
prompt = (
|
|
|
|
| 10 |
f"{input_text}\n\n"
|
| 11 |
"Análisis:"
|
| 12 |
)
|
| 13 |
+
result = generator(prompt, max_length=300, do_sample=True)
|
| 14 |
return result[0]['generated_text'].split("Análisis:")[-1].strip()
|