Spaces:
Build error
Build error
Upload llm.py
Browse files- modules/llm.py +1 -22
modules/llm.py
CHANGED
@@ -50,25 +50,4 @@ class GroqCompletion:
|
|
50 |
result += chunk.choices[0].delta.content or ""
|
51 |
|
52 |
return result
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
# # Example usage
|
57 |
-
# api_key = os.environ.get("GROQ_API_KEY")
|
58 |
-
# groq_client = GroqClient(api_key)
|
59 |
-
|
60 |
-
# model = "gemma2-9b-it"
|
61 |
-
# domain = "LLM"
|
62 |
-
# prompt_template = "Summarize me this content in just one line"
|
63 |
-
# user_content = """1. **Domain Adaptation and Inference**: He developed a novel semantic encoding and decoding (SEDO) algorithm that uses knowledge graphs to generate semantic labels for unlabeled data. He applied this algorithm to detect suicide risk on social media.
|
64 |
-
# 2. **Weighted Constraints Conditioned on Time-Evolving Events**: He developed a semi-deep infusion-based framework that integrates real-world knowledge as weighted constraints conditioned upon time-evolving events. He applied this framework to estimate the rise in infection rate during a crisis event.
|
65 |
-
# 3. **Matching and Ranking**: He developed a semi-deep K-IL system that models a patient's trust of GPs using knowledge of consultation history and ICD-10 graphs. He also applied this system to recommend patients to GPs."""
|
66 |
-
# temperature = 0
|
67 |
-
# max_tokens = 8192
|
68 |
-
# top_p = 1
|
69 |
-
# stream = True
|
70 |
-
# stop = None
|
71 |
-
|
72 |
-
# groq_completion = GroqCompletion(groq_client, model, domain, prompt_template, user_content, temperature, max_tokens, top_p, stream, stop)
|
73 |
-
# result = groq_completion.create_completion()
|
74 |
-
# print(result)
|
|
|
50 |
result += chunk.choices[0].delta.content or ""
|
51 |
|
52 |
return result
|
53 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|