Instructions to use krogoldAI/QueryRefiner-0.5B-v0.1-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use krogoldAI/QueryRefiner-0.5B-v0.1-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="krogoldAI/QueryRefiner-0.5B-v0.1-SFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("krogoldAI/QueryRefiner-0.5B-v0.1-SFT") model = AutoModelForCausalLM.from_pretrained("krogoldAI/QueryRefiner-0.5B-v0.1-SFT", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use krogoldAI/QueryRefiner-0.5B-v0.1-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "krogoldAI/QueryRefiner-0.5B-v0.1-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "krogoldAI/QueryRefiner-0.5B-v0.1-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/krogoldAI/QueryRefiner-0.5B-v0.1-SFT
- SGLang
How to use krogoldAI/QueryRefiner-0.5B-v0.1-SFT with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "krogoldAI/QueryRefiner-0.5B-v0.1-SFT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "krogoldAI/QueryRefiner-0.5B-v0.1-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "krogoldAI/QueryRefiner-0.5B-v0.1-SFT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "krogoldAI/QueryRefiner-0.5B-v0.1-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use krogoldAI/QueryRefiner-0.5B-v0.1-SFT with Docker Model Runner:
docker model run hf.co/krogoldAI/QueryRefiner-0.5B-v0.1-SFT
Update README.md
Browse files
README.md
CHANGED
|
@@ -29,29 +29,29 @@ This model is part of a two-model series addressing a critical challenge in RAG
|
|
| 29 |
|
| 30 |
User query:
|
| 31 |
|
| 32 |
-
>
|
| 33 |
|
| 34 |
Model output:
|
| 35 |
|
| 36 |
```xml
|
| 37 |
<query_analysis>
|
| 38 |
-
<domain ambiguous="
|
| 39 |
-
<candidate confidence="
|
| 40 |
-
<candidate confidence="0.4">Factual Information</candidate>
|
| 41 |
</domain>
|
| 42 |
-
<intent ambiguous="
|
| 43 |
-
<candidate confidence="
|
| 44 |
-
<candidate confidence="0.3">Interpretation</candidate>
|
| 45 |
</intent>
|
| 46 |
<concepts>
|
| 47 |
-
<explicit>
|
|
|
|
| 48 |
</concepts>
|
| 49 |
<relations>
|
| 50 |
-
<relation subject="
|
|
|
|
| 51 |
</relations>
|
| 52 |
<insufficient_context>false</insufficient_context>
|
| 53 |
<rephrased>true</rephrased>
|
| 54 |
-
<rephrased_query>
|
| 55 |
</query_analysis>
|
| 56 |
```
|
| 57 |
|
|
@@ -62,29 +62,33 @@ Model output:
|
|
| 62 |
|
| 63 |
User query:
|
| 64 |
|
| 65 |
-
>
|
| 66 |
|
| 67 |
Model output:
|
| 68 |
|
| 69 |
```xml
|
| 70 |
<query_analysis>
|
| 71 |
-
<domain ambiguous="
|
| 72 |
-
<candidate confidence="
|
|
|
|
| 73 |
</domain>
|
| 74 |
-
<intent ambiguous="
|
| 75 |
-
<candidate confidence="
|
|
|
|
| 76 |
</intent>
|
| 77 |
<concepts>
|
| 78 |
-
<explicit>
|
| 79 |
-
<implicit>
|
| 80 |
</concepts>
|
| 81 |
<relations>
|
| 82 |
-
<relation subject="
|
| 83 |
-
<relation subject="
|
|
|
|
|
|
|
| 84 |
</relations>
|
| 85 |
<insufficient_context>false</insufficient_context>
|
| 86 |
<rephrased>true</rephrased>
|
| 87 |
-
<rephrased_query>
|
| 88 |
</query_analysis>
|
| 89 |
```
|
| 90 |
|
|
@@ -95,49 +99,34 @@ Model output:
|
|
| 95 |
|
| 96 |
User query:
|
| 97 |
|
| 98 |
-
>
|
| 99 |
|
| 100 |
Model output:
|
| 101 |
|
| 102 |
```xml
|
| 103 |
<query_analysis>
|
| 104 |
<domain ambiguous="true">
|
| 105 |
-
<candidate confidence="0.5">
|
| 106 |
-
<candidate confidence="0.5">
|
| 107 |
</domain>
|
| 108 |
<intent ambiguous="true">
|
| 109 |
-
<candidate confidence="0.6">
|
| 110 |
-
<candidate confidence="0.4">
|
| 111 |
</intent>
|
| 112 |
<concepts>
|
| 113 |
-
<explicit>
|
| 114 |
-
<implicit>[
|
| 115 |
</concepts>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
<insufficient_context>true</insufficient_context>
|
| 117 |
<rephrased>true</rephrased>
|
| 118 |
-
<rephrased_query>
|
| 119 |
</query_analysis>
|
| 120 |
```
|
| 121 |
|
| 122 |
-
<!-- ```xml
|
| 123 |
-
<query_analysis>
|
| 124 |
-
<domain ambiguous="true">
|
| 125 |
-
<candidate confidence="0.5">Technology</candidate>
|
| 126 |
-
<candidate confidence="0.5">Engineering</candidate>
|
| 127 |
-
</domain>
|
| 128 |
-
<intent ambiguous="true">
|
| 129 |
-
<candidate confidence="0.6">Technical capabilities</candidate>
|
| 130 |
-
<candidate confidence="0.4">Performance enhancement</candidate>
|
| 131 |
-
</intent>
|
| 132 |
-
<concepts>
|
| 133 |
-
<explicit>performance</explicit>
|
| 134 |
-
</concepts>
|
| 135 |
-
<insufficient_context>true</insufficient_context>
|
| 136 |
-
<rephrased>true</rephrased>
|
| 137 |
-
<rephrased_query>techniques used to enhance the functionality of [PRODUCT/SERVICE]</rephrased_query>
|
| 138 |
-
</query_analysis>
|
| 139 |
-
``` -->
|
| 140 |
-
|
| 141 |
</details>
|
| 142 |
|
| 143 |
|
|
|
|
| 29 |
|
| 30 |
User query:
|
| 31 |
|
| 32 |
+
>How can artificial intelligence be utilized to improve emergency response systems in urban environments?
|
| 33 |
|
| 34 |
Model output:
|
| 35 |
|
| 36 |
```xml
|
| 37 |
<query_analysis>
|
| 38 |
+
<domain ambiguous="false">
|
| 39 |
+
<candidate confidence="1.0">Technology</candidate>
|
|
|
|
| 40 |
</domain>
|
| 41 |
+
<intent ambiguous="false">
|
| 42 |
+
<candidate confidence="1.0">Improving emergency response systems</candidate>
|
|
|
|
| 43 |
</intent>
|
| 44 |
<concepts>
|
| 45 |
+
<explicit>artificial intelligence, emergency response systems, urban environments</explicit>
|
| 46 |
+
<implicit>smart city, predictive analytics, data-driven decision making</implicit>
|
| 47 |
</concepts>
|
| 48 |
<relations>
|
| 49 |
+
<relation subject="artificial intelligence" predicate="utilized to" object="improve emergency response systems"/>
|
| 50 |
+
<relation subject="emergency response systems" predicate="in" object="urban environments"/>
|
| 51 |
</relations>
|
| 52 |
<insufficient_context>false</insufficient_context>
|
| 53 |
<rephrased>true</rephrased>
|
| 54 |
+
<rephrased_query>how artificial intelligence can be used to enhance emergency response capabilities in urban areas</rephrased_query>
|
| 55 |
</query_analysis>
|
| 56 |
```
|
| 57 |
|
|
|
|
| 62 |
|
| 63 |
User query:
|
| 64 |
|
| 65 |
+
>How have its fiscal policies regarding these things impacted its overall financial stability and future outlook, particularly concerning external market fluctuations?
|
| 66 |
|
| 67 |
Model output:
|
| 68 |
|
| 69 |
```xml
|
| 70 |
<query_analysis>
|
| 71 |
+
<domain ambiguous="true">
|
| 72 |
+
<candidate confidence="0.6">Economics</candidate>
|
| 73 |
+
<candidate confidence="0.4">Finance</candidate>
|
| 74 |
</domain>
|
| 75 |
+
<intent ambiguous="true">
|
| 76 |
+
<candidate confidence="0.7">Analysis</candidate>
|
| 77 |
+
<candidate confidence="0.3">Comparison</candidate>
|
| 78 |
</intent>
|
| 79 |
<concepts>
|
| 80 |
+
<explicit>fiscal policies, external market fluctuations, financial stability, future outlook</explicit>
|
| 81 |
+
<implicit>[ENTITY], economic factors</implicit>
|
| 82 |
</concepts>
|
| 83 |
<relations>
|
| 84 |
+
<relation subject="[ENTITY]" predicate="has" object="fiscal policies"/>
|
| 85 |
+
<relation subject="[ENTITY]" predicate="impacts" object="financial stability"/>
|
| 86 |
+
<relation subject="[ENTITY]" predicate="impacts" object="future outlook"/>
|
| 87 |
+
<relation subject="[ENTITY]" predicate="causes" object="external market fluctuations"/>
|
| 88 |
</relations>
|
| 89 |
<insufficient_context>false</insufficient_context>
|
| 90 |
<rephrased>true</rephrased>
|
| 91 |
+
<rephrased_query>impact of [ENTITY]'s fiscal policies on financial stability and future outlook, particularly due to external market volatility</rephrased_query>
|
| 92 |
</query_analysis>
|
| 93 |
```
|
| 94 |
|
|
|
|
| 99 |
|
| 100 |
User query:
|
| 101 |
|
| 102 |
+
>How does she describe her emotional journey and the complexities of her interactions with him in that book?
|
| 103 |
|
| 104 |
Model output:
|
| 105 |
|
| 106 |
```xml
|
| 107 |
<query_analysis>
|
| 108 |
<domain ambiguous="true">
|
| 109 |
+
<candidate confidence="0.5">Literature</candidate>
|
| 110 |
+
<candidate confidence="0.5">Psychology</candidate>
|
| 111 |
</domain>
|
| 112 |
<intent ambiguous="true">
|
| 113 |
+
<candidate confidence="0.6">Analysis</candidate>
|
| 114 |
+
<candidate confidence="0.4">Description</candidate>
|
| 115 |
</intent>
|
| 116 |
<concepts>
|
| 117 |
+
<explicit>emotional journey, complex interactions</explicit>
|
| 118 |
+
<implicit>[PERSON], [BOOK]</implicit>
|
| 119 |
</concepts>
|
| 120 |
+
<relations>
|
| 121 |
+
<relation subject="[PERSON]" predicate="describes" object="complex emotions"/>
|
| 122 |
+
<relation subject="[PERSON]" predicate="interacts with" object="him"/>
|
| 123 |
+
</relations>
|
| 124 |
<insufficient_context>true</insufficient_context>
|
| 125 |
<rephrased>true</rephrased>
|
| 126 |
+
<rephrased_query>How does [PERSON] describe their emotional journey and the intricacies of their interactions with [PERSON] in the book?</rephrased_query>
|
| 127 |
</query_analysis>
|
| 128 |
```
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
</details>
|
| 131 |
|
| 132 |
|