Skip to content

Commit 53b4e27

Browse files
committed
fix
1 parent af64dba commit 53b4e27

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

articles/ai-foundry/model-inference/tutorials/get-started-deepseek-r1.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -143,37 +143,19 @@ Reasoning may generate longer responses and consume a larger number of tokens. Y
143143

144144
### Reasoning content
145145

146-
Some reasoning models, like DeepSeek-R1, generate completions and include the reasoning behind it. The reasoning associated with the completion is included in the response's content within the tags `<think>` and `</think>`. The model may select on which scenarios to generate reasoning content. You following example shows how to do it in Python:
146+
Some reasoning models, like DeepSeek-R1, generate completions and include the reasoning behind it. The reasoning associated with the completion is included in the response's `reasoning_content` field. The model may select on which scenarios to generate reasoning content.
147147

148148
```python
149-
import re
150-
151-
match = re.match(r"<think>(.*?)</think>(.*)", response.choices[0].message.content, re.DOTALL)
152-
153-
print("Response:", )
154-
if match:
155-
print("\tThinking:", match.group(1))
156-
print("\tAnswer:", match.group(2))
157-
else:
158-
print("\tAnswer:", response.choices[0].message.content)
159-
print("Model:", response.model)
160-
print("Usage:")
161-
print("\tPrompt tokens:", response.usage.prompt_tokens)
162-
print("\tTotal tokens:", response.usage.total_tokens)
163-
print("\tCompletion tokens:", response.usage.completion_tokens)
149+
print("Thinking:", response.choices[0].message.reasoning_content)
164150
```
165151

166152
```console
167153
Thinking: Okay, the user is asking how many languages exist in the world. I need to provide a clear and accurate answer. Let's start by recalling the general consensus from linguistic sources. I remember that the number often cited is around 7,000, but maybe I should check some reputable organizations.\n\nEthnologue is a well-known resource for language data, and I think they list about 7,000 languages. But wait, do they update their numbers? It might be around 7,100 or so. Also, the exact count can vary because some sources might categorize dialects differently or have more recent data. \n\nAnother thing to consider is language endangerment. Many languages are endangered, with some having only a few speakers left. Organizations like UNESCO track endangered languages, so mentioning that adds context. Also, the distribution isn't even. Some countries have hundreds of languages, like Papua New Guinea with over 800, while others have just a few. \n\nA user might also wonder why the exact number is hard to pin down. It's because the distinction between a language and a dialect can be political or cultural. For example, Mandarin and Cantonese are considered dialects of Chinese by some, but they're mutually unintelligible, so others classify them as separate languages. Also, some regions are under-researched, making it hard to document all languages. \n\nI should also touch on language families. The 7,000 languages are grouped into families like Indo-European, Sino-Tibetan, Niger-Congo, etc. Maybe mention a few of the largest families. But wait, the question is just about the count, not the families. Still, it's good to provide a bit more context. \n\nI need to make sure the information is up-to-date. Let me think – recent estimates still hover around 7,000. However, languages are dying out rapidly, so the number decreases over time. Including that note about endangerment and language extinction rates could be helpful. For instance, it's often stated that a language dies every few weeks. \n\nAnother point is sign languages. Does the count include them? Ethnologue includes some, but not all sources might. If the user is including sign languages, that adds more to the count, but I think the 7,000 figure typically refers to spoken languages. For thoroughness, maybe mention that there are also over 300 sign languages. \n\nSummarizing, the answer should state around 7,000, mention Ethnologue's figure, explain why the exact number varies, touch on endangerment, and possibly note sign languages as a separate category. Also, a brief mention of Papua New Guinea as the most linguistically diverse country. \n\nWait, let me verify Ethnologue's current number. As of their latest edition (25th, 2022), they list 7,168 living languages. But I should check if that's the case. Some sources might round to 7,000. Also, SIL International publishes Ethnologue, so citing them as reference makes sense. \n\nOther sources, like Glottolog, might have a different count because they use different criteria. Glottolog might list around 7,000 as well, but exact numbers vary. It's important to highlight that the count isn't exact because of differing definitions and ongoing research. \n\nIn conclusion, the approximate number is 7,000, with Ethnologue being a key source, considerations of endangerment, and the challenges in counting due to dialect vs. language distinctions. I should make sure the answer is clear, acknowledges the variability, and provides key points succinctly.
168-
169-
Answer: The exact number of languages in the world is challenging to determine due to differences in definitions (e.g., distinguishing languages from dialects) and ongoing documentation efforts. However, widely cited estimates suggest there are approximately **7,000 languages** globally.
170-
Model: DeepSeek-R1
171-
Usage:
172-
Prompt tokens: 11
173-
Total tokens: 897
174-
Completion tokens: 886
175154
```
176155

156+
> [!TIP]
157+
> Ensure you are using the latest version of Azure AI Inference SDK which introduces support for `reasoning_content` in the inference API version `2025-04-01`.
158+
177159

178160
### Parameters
179161

0 commit comments

Comments
 (0)